Skip to main content

CLI Setup

The jd CLI lets terminal-based AI agents (like Claude Code) and humans interact with AgentGate from the command line. It's also useful for scripting and CI/CD pipelines.

Installation​

npm install -g @orbiscend/jd-cli

Verify the installation:

jd --version

Initial Configuration​

Run the interactive setup:

jd init --global

This prompts you for:

  1. Endpoint URL — copy from Jira → Apps → AgentGate for Jira - Tokens
  2. API Token — your jfa_ token
  3. Default Project — your Jira project key (e.g., PROJ)

The config is saved to ~/.agentgate-for-jira/config.json and is also read by the MCP server automatically.

Project-Level Config​

For project-specific settings, run jd init (without --global) in your project directory. This creates .agentgate-for-jira/config.json in the current directory, which takes priority over the global config.

Manual Configuration​

You can also set config values individually:

jd config set endpoint "https://your-endpoint-url"
jd config set token "jfa_your_token"
jd config set project "PROJ"

Or use environment variables (JD_ENDPOINT, JD_TOKEN, JD_PROJECT) — these take highest priority.

Verify Your Connection​

jd status

This shows your connection status, token validity, and the authenticated user. Then:

jd prime

This shows your project overview: in-progress issues, pending changes, and tips.

Command Reference​

Session​

CommandDescription
jd primeProject overview: in-progress issues, pending changes, tips
jd statusConnection and token status

Issues​

CommandDescription
jd issues listList issues (add --status, --assignee, --labels, --jql filters)
jd issues show KEYFull issue details
jd issues show KEY -cFull context: parent, children, links, recent comments
jd issues children KEYList child issues
jd issues transition KEY "STATUS"Move issue to new status (pending approval)
jd issues assign KEY "NAME"Assign issue (pending approval)

Changes​

CommandDescription
jd changes create --type TYPEPropose a change (create, update, transition, delete)
jd changes listList changes (add --status pending/approved/rejected/failed)
jd changes show IDView change details and diff
jd changes update IDModify a pending change
jd changes cancel IDCancel a pending change
jd changes approve IDApprove a pending change
jd changes reject ID --reason "..."Reject with reason

Comments​

CommandDescription
jd comment KEY --body "TEXT"Add comment to issue (pending approval)

Configuration​

CommandDescription
jd initInteractive setup (local config)
jd init --globalInteractive setup (global config)
jd config showShow current config and sources
jd config set KEY VALUESet a config value
jd config unset KEYRemove a config value

Other​

CommandDescription
jd workflow describeShow project workflow (issue types and status transitions)
jd autocomplete [SHELL]Set up shell tab completion (zsh, bash, PowerShell)

Global Flags​

These flags work with any command and override config file settings:

FlagDescription
--jsonOutput as JSON (useful for scripting and AI agents)
--endpoint URLOverride endpoint URL
--project KEYOverride default project
--token TOKENOverride API token

Shell Completion​

Set up tab completion for faster command entry:

jd autocomplete zsh # or bash, powershell

Follow the printed instructions to add the completion script to your shell profile.

Exit Codes​

CodeMeaning
0Success
1Usage or configuration error
2API or service error
3Authentication error
4Internal error

Custom PRIME.md​

Customize jd prime output by creating .agentgate-for-jira/PRIME.md in your project directory. Available placeholders:

PlaceholderReplaced with
{{project}}Current project key
{{pending_count}}Number of pending changes
{{failed_count}}Number of failed changes
{{pending_changes}}Formatted list of pending changes
{{failed_changes}}Formatted list of failed changes

This is useful for embedding project-specific workflow rules or instructions that your AI agent should follow.