Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 5 additions & 18 deletions apps/cli/src/commands/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,11 @@ type Params = Record<string, ParamValue | ParamValue[]>;
const api = new BeeCommand("api")
.summary("Make an authenticated API request")
.description(
`Make an authenticated Backlog API request.

The endpoint argument should be a path of the Backlog API
(e.g. \`users/myself\`). If the path includes the \`/api/v2/\` prefix
it is stripped automatically — both \`users/myself\` and
\`/api/v2/users/myself\` work the same way.

Use \`--field\` / \`-f\` to pass parameters with automatic type inference:
numeric strings become numbers, \`true\`/\`false\` become booleans, and
everything else stays a string. Use \`--raw-field\` / \`-F\` to force a
value to remain a string. Both flags can be specified multiple times.
When the same key is repeated, values are collected into an array
(e.g. \`-f statusId=1 -f statusId=2 -f statusId=3\`).
To send a single-element array, append \`[]\` to the key name
(e.g. \`-f projectId[]=12345\`).

For GET requests, fields are sent as query parameters. For POST, PUT,
PATCH, and DELETE requests, fields are sent as the request body.`,
`The endpoint is a Backlog API path (e.g. \`users/myself\`). A leading \`/api/v2/\` prefix is stripped automatically.

\`-f\` infers types (number, boolean, string); \`-F\` always sends strings. Repeated keys become arrays. Append \`[]\` for a single-element array (e.g. \`-f projectId[]=12345\`).

For GET, fields are query parameters. For POST/PUT/PATCH/DELETE, fields are the request body.`,
)
.argument("<endpoint>", "API endpoint path")
.option("-X, --method <method>", "HTTP method", "GET")
Expand Down
10 changes: 3 additions & 7 deletions apps/cli/src/commands/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ import { BeeCommand } from "../../lib/bee-command";
const login = new BeeCommand("login")
.summary("Authenticate with a Backlog space")
.description(
`Authenticate with a Backlog space.
`The default mode is API key with interactive prompts.

The default authentication mode is API key. You will be prompted to enter
the space hostname and API key interactively.

Alternatively, use \`--with-token\` to pass an API key on standard input.
For OAuth authentication, use \`--method oauth\`. You will need to provide
an OAuth Client ID and Client Secret, then authorize in the browser.`,
Use \`--with-token\` to pass an API key on standard input.
Use \`--method oauth\` for OAuth authentication via the browser.`,
)
.option("-m, --method <method>", "The authentication method to use", "api-key")
.option("--with-token", "Read token from standard input")
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/auth/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import { BeeCommand } from "../../lib/bee-command";
const logout = new BeeCommand("logout")
.summary("Remove authentication for a Backlog space")
.description(
`Remove authentication for a Backlog space.

The stored credentials are removed locally. This does not revoke API keys or OAuth tokens on the Backlog server.

If only one space is configured, it will be selected automatically. If multiple spaces are configured, you will be prompted to select one.`,
`Removes stored credentials locally. Does not revoke API keys or OAuth tokens on the server.`,
)
.option("-s, --space <hostname>", "The hostname of the Backlog space")
.envVars([["BACKLOG_SPACE", "Space hostname to log out from"]])
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/auth/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import { BeeCommand } from "../../lib/bee-command";
const refresh = new BeeCommand("refresh")
.summary("Refresh OAuth token")
.description(
`Refresh the OAuth access token for a Backlog space.

Uses the stored refresh token to obtain a new access token. Only available for spaces authenticated with OAuth.

If the refresh token is expired or invalid, re-authenticate with \`bee auth login -m oauth\`.`,
`Only available for spaces authenticated with OAuth. If the refresh token is expired, re-authenticate with \`bee auth login -m oauth\`.`,
)
.option("-s, --space <hostname>", "The hostname of the Backlog space")
.envVars([["BACKLOG_SPACE", "Default space hostname"]])
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/auth/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ const getToken = (auth: RcAuth): string =>
const status = new BeeCommand("status")
.summary("Show authentication status")
.description(
`Display authentication status for configured Backlog spaces.

For each space, the authentication method and credential validity are
verified by calling the Backlog API. The active (default) space is indicated
so you can see which space is used when \`--space\` is not provided.`,
`Verifies credential validity for each configured space via the Backlog API. The active (default) space is indicated.`,
)
.option("-s, --space <hostname>", "The hostname of the Backlog space")
.option("--show-token", "Display the auth token")
Expand Down
12 changes: 1 addition & 11 deletions apps/cli/src/commands/auth/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,7 @@ import { BeeCommand } from "../../lib/bee-command";

const switchSpace = new BeeCommand("switch")
.summary("Switch active space")
.description(
`Switch the active (default) Backlog space.

Changes which space is used by default when running commands without
\`--space\`.

If multiple spaces are configured, you will be prompted to select one
interactively. Use \`--space\` to switch directly without a prompt.

For a list of configured spaces, see \`bee auth status\`.`,
)
.description(`Changes which space is used by default when \`--space\` is not provided.`)
.option("-s, --space <hostname>", "The hostname of the Backlog space")
.envVars([["BACKLOG_SPACE", "Space hostname to switch to"]])
.examples([
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/auth/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { BeeCommand } from "../../lib/bee-command";
const tokenCommand = new BeeCommand("token")
.summary("Print the auth token to stdout")
.description(
`Print the auth token for a Backlog space to standard output.

Without \`--space\`, the default space is used.

The token output can be used with \`BACKLOG_API_KEY\` or piped to other commands.`,
`Prints the token for the default space, or the space given by \`--space\`. Useful for piping to other commands.`,
)
.option("-s, --space <hostname>", "The hostname of the Backlog space")
.envVars([["BACKLOG_SPACE", "Default space hostname"]])
Expand Down
14 changes: 2 additions & 12 deletions apps/cli/src/commands/browse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,9 @@ import { resolveUrl } from "./browse-url";
const browse = new BeeCommand("browse")
.summary("Open a Backlog page in the browser")
.description(
`Open a Backlog page in the browser.
`With no arguments, opens the repository page (inside a Backlog repo) or the dashboard.

With no arguments, the behavior depends on context. Inside a Backlog Git
repository it opens the repository page; otherwise it opens the dashboard.

When given an issue key (e.g. \`PROJECT-123\`), opens that issue. A bare
number like \`123\` is also accepted when the project can be inferred from
the Git remote. Use \`--project\` with section flags to navigate directly
to a specific project page.

A file path opens the file in the Backlog Git viewer (e.g. \`src/main.ts\`).
Append \`:<line>\` to jump to a specific line (e.g. \`src/main.ts:42\`).
Paths ending with \`/\` open the directory tree view.`,
Accepts an issue key (\`PROJECT-123\`), bare number (\`123\`, project inferred from Git remote), file path (\`src/main.ts\`), or path with line (\`src/main.ts:42\`). Paths ending with \`/\` open the directory tree. Use \`--project\` with section flags (e.g. \`--issues\`, \`--board\`) for project pages.`,
)
.argument("[target]", "Issue key, issue number, file path, or project key")
.addOption(opt.project().makeOptionMandatory(false).default(undefined))
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/category/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { resolveOptions } from "../../lib/required-option";

const create = new BeeCommand("create")
.summary("Create a category")
.description(
`Create a new category in a Backlog project.

If \`--name\` is not provided, you will be prompted interactively.`,
)
.description(`Omitted fields will be prompted interactively.`)
.addOption(opt.project())
.option("-n, --name <value>", "Category name")
.addOption(opt.json())
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/category/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { resolveOptions } from "../../lib/required-option";

const deleteCategory = new BeeCommand("delete")
.summary("Delete a category")
.description(
`Delete a category from a Backlog project.

This action is irreversible. You will be prompted for confirmation unless
\`--yes\` is provided.`,
)
.description(`This action is irreversible.`)
.argument("<category>", "Category ID")
.addOption(opt.project())
.option("-y, --yes", "Skip confirmation prompt")
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/category/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { resolveOptions } from "../../lib/required-option";

const edit = new BeeCommand("edit")
.summary("Edit a category")
.description(
`Update an existing category in a Backlog project.

Renames the specified category.`,
)
.description(`Renames the specified category.`)
.argument("<category>", "Category ID")
.addOption(opt.project())
.option("-n, --name <value>", "New name of the category")
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/category/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import * as opt from "../../lib/common-options";

const list = new BeeCommand("list")
.summary("List categories")
.description(
`List categories in a Backlog project.

Categories help organize issues by grouping them into logical areas.`,
)
.description(`Categories help organize issues by grouping them into logical areas.`)
.argument("[project]", "Project ID or project key")
.addOption(opt.json())
.envVars([...ENV_AUTH, ENV_PROJECT])
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ complete -c bee -n "__fish_use_subcommand" -a "completion" -d "completion comman

const completion = new BeeCommand("completion")
.summary("Generate shell completion scripts")
.description(
`Generate shell completion scripts for bee.

The generated script should be sourced in your shell's configuration file.
Follow the instructions in the output for your specific shell.`,
)
.description(`Supported shells: bash, zsh, fish. Source the output in your shell configuration.`)
.argument("<shell>", "Shell to generate completions for")
.examples([
{
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import * as opt from "../lib/common-options";
const dashboard = new BeeCommand("dashboard")
.summary("Show a summary of your Backlog activity")
.description(
`Show a summary of your Backlog activity.

Displays your assigned issues sorted by due date, unread notification count,
and your projects. The layout is modeled after the Backlog web dashboard.

Use \`--web\` to open the Backlog dashboard in your browser instead.`,
`Displays assigned issues, unread notifications, and projects. Use \`--web\` to open in the browser.`,
)
.addOption(opt.json())
.addOption(opt.web("dashboard"))
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/document/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import * as opt from "../../lib/common-options";

const attachments = new BeeCommand("attachments")
.summary("List document attachments")
.description(
`List attachments of a Backlog document.

Shows file name, size, creator, and creation date.`,
)
.description(`Shows file name, size, creator, and creation date.`)
.argument("<document>", "Document ID")
.addOption(opt.json())
.envVars([...ENV_AUTH])
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/document/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import * as opt from "../../lib/common-options";
const create = new BeeCommand("create")
.summary("Create a document")
.description(
`Create a new Backlog document.

Requires a project and title. When run interactively, omitted required
fields will be prompted.

When input is piped, it is used as the body automatically.`,
`Omitted required fields will be prompted interactively. When input is piped, it is used as the body automatically.`,
)
.option("-p, --project <id>", "Project ID or project key")
.option("-t, --title <text>", "Document title")
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/document/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import * as opt from "../../lib/common-options";

const deleteDocument = new BeeCommand("delete")
.summary("Delete a document")
.description(
`Delete a Backlog document.

This action is irreversible. You will be prompted for confirmation unless
\`--yes\` is provided.`,
)
.description(`This action is irreversible.`)
.argument("<document>", "Document ID")
.option("-y, --yes", "Skip confirmation prompt")
.addOption(opt.json())
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/document/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import { resolveOptions } from "../../lib/required-option";

const list = new BeeCommand("list")
.summary("List documents")
.description(
`List documents from a Backlog project.

Use \`--sort\` to change the sort field and \`--keyword\` to search within
document titles and content.`,
)
.description(`Use \`--keyword\` to search within document titles and content.`)
.addOption(opt.project())
.addOption(opt.keyword())
.option("--sort <field>", "Sort field {created|updated}")
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/document/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ const renderTree = (children: Entity.Document.DocumentTreeNode[]): string[] => {

const tree = new BeeCommand("tree")
.summary("Display document tree")
.description(
`Display the document tree structure of a Backlog project.

Shows the hierarchical structure of documents with tree-style indentation.`,
)
.description(`Shows the hierarchical structure of documents with tree-style indentation.`)
.argument("[project]", "Project ID or project key", process.env.BACKLOG_PROJECT)
.addOption(opt.json())
.envVars([...ENV_AUTH, ENV_PROJECT])
Expand Down
9 changes: 1 addition & 8 deletions apps/cli/src/commands/document/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ import * as opt from "../../lib/common-options";

const view = new BeeCommand("view")
.summary("View a document")
.description(
`Display details of a Backlog document.

Shows the document title, metadata, and body content.

Use \`--web\` to open the document in your default browser instead. The
\`--project\` flag is required when using \`--web\`.`,
)
.description(`Use \`--web\` to open in the browser (\`--project\` is required for \`--web\`).`)
.argument("<document>", "Document ID")
.option("-p, --project <id>", "Project ID or project key (required for --web)")
.addOption(opt.web("document"))
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/issue-type/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { resolveOptions } from "../../lib/required-option";

const create = new BeeCommand("create")
.summary("Create an issue type")
.description(
`Create a new issue type in a Backlog project.

If \`--name\` is not provided, you will be prompted interactively.
The \`--color\` flag must be one of the predefined Backlog colors.`,
)
.description(`Omitted fields will be prompted interactively.`)
.addOption(opt.project())
.option("-n, --name <value>", "Issue type name")
.requiredOption(
Expand Down
9 changes: 1 addition & 8 deletions apps/cli/src/commands/issue-type/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@ import { resolveOptions } from "../../lib/required-option";
const deleteIssueType = new BeeCommand("delete")
.summary("Delete an issue type")
.description(
`Delete an issue type from a Backlog project.

When deleting an issue type, all issues of that type must be reassigned
to another issue type. Use \`--substitute-issue-type-id\` to specify
the replacement.

This action is irreversible. You will be prompted for confirmation unless
\`--yes\` is provided.`,
`All issues of this type are reassigned to the substitute issue type. This action is irreversible.`,
)
.argument("<issueType>", "Issue type ID")
.addOption(opt.project())
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/issue-type/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import { resolveOptions } from "../../lib/required-option";

const edit = new BeeCommand("edit")
.summary("Edit an issue type")
.description(
`Update an existing issue type in a Backlog project.

Only the specified fields will be updated. Fields that are not provided
will remain unchanged.`,
)
.description(`Only specified fields are updated; others remain unchanged.`)
.argument("<issueType>", "Issue type ID")
.addOption(opt.project())
.option("-n, --name <value>", "New name of the issue type")
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/issue-type/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import * as opt from "../../lib/common-options";

const list = new BeeCommand("list")
.summary("List issue types")
.description(
`List issue types in a Backlog project.

Issue types categorize issues and are displayed with their associated color.`,
)
.description(`Issue types categorize issues and are displayed with their associated color.`)
.argument("[project]", "Project ID or project key")
.addOption(opt.json())
.envVars([...ENV_AUTH, ENV_PROJECT])
Expand Down
6 changes: 1 addition & 5 deletions apps/cli/src/commands/issue/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import * as opt from "../../lib/common-options";

const attachments = new BeeCommand("attachments")
.summary("List issue attachments")
.description(
`List attachments of a Backlog issue.

Shows file name, size, creator, and creation date.`,
)
.description(`Shows file name, size, creator, and creation date.`)
.argument("<issue>", "Issue ID or issue key")
.addOption(opt.json())
.envVars([...ENV_AUTH])
Expand Down
7 changes: 1 addition & 6 deletions apps/cli/src/commands/issue/close.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ import * as opt from "../../lib/common-options";
const close = new BeeCommand("close")
.summary("Close an issue")
.description(
`Close a Backlog issue by setting its status to \`Closed\`.

By default the resolution is set to \`Fixed\`. Use \`--resolution\` to
specify a different resolution.

Optionally add a comment with \`--comment\`.`,
`Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`,
)
.argument("<issue>", "Issue ID or issue key")
.option("-c, --comment <text>", "Comment to add when closing")
Expand Down
Loading