diff --git a/README.md b/README.md index e69de29..41ecdaa 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,41 @@ +# Workspaces + +## Usage + +``` bash + + Usage: workspaces.py [OPTIONS] COMMAND [ARGS]... + + Workspace management tool + +╭─ Options ────────────────────────────────────────────────────────────────────╮ +│ --workspaces-name -W TEXT Logical name for this workspace set │ +│ (e.g. 'git', 'work', 'personal'). │ +│ Overrides WORKSPACES_NAME env. Defaults │ +│ to 'git'. │ +│ --install-completion Install completion for the current │ +│ shell. │ +│ --show-completion Show completion for the current shell, │ +│ to copy it or customize the │ +│ installation. │ +│ --help Show this message and exit. │ +╰──────────────────────────────────────────────────────────────────────────────╯ +╭─ Commands ───────────────────────────────────────────────────────────────────╮ +│ list List all workspaces. │ +│ create Create a new workspace. │ +│ list-repos List repos and branches in the current (or specified) │ +│ workspace. │ +│ add-repo Add a repo to a workspace. │ +│ rm Remove a workspace: │ +│ wip For each repo in the workspace: │ +│ commit For each repo in the workspace: │ +│ push For each repo in the workspace, run 'git push │ +│ '. │ +│ status Show detailed status for the current (or specified) workspace. │ +│ diff Show git diff for all repos in the workspace. Uses rich Syntax │ +│ highlighter for diffs. │ +│ attach Attach to a workspace. │ +│ tmux tmux commands │ +╰──────────────────────────────────────────────────────────────────────────────╯ + +``` diff --git a/justfile b/justfile index 77f84ef..2c090fa 100644 --- a/justfile +++ b/justfile @@ -5,3 +5,13 @@ format: check: uv run ruff check . --fix uv run ty check . + +readme: + echo "# Workspaces" > README.md + echo "" >> README.md + echo "## Usage" >> README.md + echo "" >> README.md + echo '``` bash' >> README.md + COLUMNS=80 ./workspaces.py --help >> README.md + echo '```' >> README.md + diff --git a/workspaces.py b/workspaces.py index 91da02c..6b304e6 100755 --- a/workspaces.py +++ b/workspaces.py @@ -1507,7 +1507,7 @@ def tmux_cli_attach( ), ): """ - Attach or create a session for a repo in a workspace. + Attach or create a tmux session for a repo in a workspace. """ _settings, _repos_dir, workspaces_dir = get_ctx_paths(ctx) ws_dir = find_workspace_dir(workspaces_dir, workspace) @@ -1536,6 +1536,9 @@ def tmux_cli_list_sessions( ), ), ): + """ + List tmux workspace sessions. + """ if not_in_tmux(): console.print("[red]Not in tmux. Exiting.[/red]") raise typer.Exit(1) @@ -1569,6 +1572,9 @@ def tmux_cli_remove( help="Don't actually remove the session.", ), ): + """ + Remove tmux workspace sessions. + """ if not_in_tmux(): console.print("[red]Not in tmux. Exiting.[/red]") raise typer.Exit(1) @@ -1612,6 +1618,9 @@ def attach( ), ), ): + """ + Attach to a workspace. + """ _settings, _repos_dir, workspaces_dir = get_ctx_paths(ctx) if len(list_workspaces(workspaces_dir)) == 0: import sys