Skip to content

Commit 87d5531

Browse files
committed
docs(cli[stop,new,copy,delete]): Add command docs and API pages
why: New CLI commands need user-facing and API documentation. what: - Add CLI doc pages for stop, new, copy, delete - Add API doc pages for stop, new, copy, delete - Update toctrees in cli/index.md and api/cli/index.md
1 parent 0cf7243 commit 87d5531

10 files changed

Lines changed: 164 additions & 0 deletions

File tree

docs/api/cli/copy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tmuxp copy - `tmuxp.cli.copy`
2+
3+
```{eval-rst}
4+
.. automodule:: tmuxp.cli.copy
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
```

docs/api/cli/delete.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tmuxp delete - `tmuxp.cli.delete`
2+
3+
```{eval-rst}
4+
.. automodule:: tmuxp.cli.delete
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
```

docs/api/cli/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ ls
1919
progress
2020
search
2121
shell
22+
stop
23+
new
24+
copy
25+
delete
2226
utils
2327
```
2428

docs/api/cli/new.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tmuxp new - `tmuxp.cli.new`
2+
3+
```{eval-rst}
4+
.. automodule:: tmuxp.cli.new
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
```

docs/api/cli/stop.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# tmuxp stop - `tmuxp.cli.stop`
2+
3+
```{eval-rst}
4+
.. automodule:: tmuxp.cli.stop
5+
:members:
6+
:show-inheritance:
7+
:undoc-members:
8+
```

docs/cli/copy.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
(cli-copy)=
2+
3+
(cli-copy-reference)=
4+
5+
# tmuxp copy
6+
7+
Copy an existing workspace config to a new name. Source is resolved using the same logic as `tmuxp load` (supports names, paths, and extensions).
8+
9+
## Command
10+
11+
```{eval-rst}
12+
.. argparse::
13+
:module: tmuxp.cli
14+
:func: create_parser
15+
:prog: tmuxp
16+
:path: copy
17+
```
18+
19+
## Basic usage
20+
21+
Copy a workspace:
22+
23+
```console
24+
$ tmuxp copy myproject myproject-backup
25+
```

docs/cli/delete.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(cli-delete)=
2+
3+
(cli-delete-reference)=
4+
5+
# tmuxp delete
6+
7+
Delete one or more workspace config files. Prompts for confirmation unless `-y` is passed.
8+
9+
## Command
10+
11+
```{eval-rst}
12+
.. argparse::
13+
:module: tmuxp.cli
14+
:func: create_parser
15+
:prog: tmuxp
16+
:path: delete
17+
```
18+
19+
## Basic usage
20+
21+
Delete a workspace:
22+
23+
```console
24+
$ tmuxp delete old-project
25+
```
26+
27+
Delete without confirmation:
28+
29+
```console
30+
$ tmuxp delete -y old-project
31+
```
32+
33+
Delete multiple workspaces:
34+
35+
```console
36+
$ tmuxp delete proj1 proj2
37+
```

docs/cli/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ load
1212
shell
1313
ls
1414
search
15+
stop
1516
```
1617

1718
```{toctree}
@@ -22,6 +23,9 @@ edit
2223
import
2324
convert
2425
freeze
26+
new
27+
copy
28+
delete
2529
```
2630

2731
```{toctree}

docs/cli/new.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
(cli-new)=
2+
3+
(cli-new-reference)=
4+
5+
# tmuxp new
6+
7+
Create a new workspace configuration file from a minimal template and open it in `$EDITOR`. If the workspace already exists, it opens for editing.
8+
9+
## Command
10+
11+
```{eval-rst}
12+
.. argparse::
13+
:module: tmuxp.cli
14+
:func: create_parser
15+
:prog: tmuxp
16+
:path: new
17+
```
18+
19+
## Basic usage
20+
21+
Create a new workspace:
22+
23+
```console
24+
$ tmuxp new myproject
25+
```

docs/cli/stop.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
(cli-stop)=
2+
3+
(cli-stop-reference)=
4+
5+
# tmuxp stop
6+
7+
Stop (kill) a running tmux session. If `on_project_stop` is defined in the workspace config, that hook runs before the session is killed.
8+
9+
## Command
10+
11+
```{eval-rst}
12+
.. argparse::
13+
:module: tmuxp.cli
14+
:func: create_parser
15+
:prog: tmuxp
16+
:path: stop
17+
```
18+
19+
## Basic usage
20+
21+
Stop a session by name:
22+
23+
```console
24+
$ tmuxp stop mysession
25+
```
26+
27+
Stop the currently attached session:
28+
29+
```console
30+
$ tmuxp stop
31+
```
32+
33+
Use a custom socket:
34+
35+
```console
36+
$ tmuxp stop -L mysocket mysession
37+
```

0 commit comments

Comments
 (0)