This document provides guidance for LLM agents using the atl CLI tool.
atl is a command-line tool for Jira and Confluence. All commands support --json for structured output, making it ideal for programmatic use.
atl auth status # Check authentication status
atl auth login # Authenticate (opens browser)Switch between Atlassian instances using aliases:
# Create aliases
atl config set-alias prod # alias "prod" → current host
atl config set-alias sandbox mycompany-sandbox.atlassian.net # alias → specific host
# Switch active host
atl config use-context prod # by alias
atl config use-context mycompany.atlassian.net # by hostname
# Show current context
atl config current-context # prints alias + hostname
atl config current-context --json # JSON output
# Remove alias
atl config delete-alias sandbox
# View aliases
atl config list # shows Aliases section with (current) markerAliases also work with --hostname flags: atl auth status --hostname prod
atl issue view PROJ-1234 # View issue details (includes custom fields)
atl issue view PROJ-1234 --json # View as JSON (includes custom_fields section)
atl issue view PROJ-1234 --web # Open in browseratl issue list --assignee @me # Your assigned issues
atl issue list --project PROJ # Issues in project
atl issue list --jql "status = Open" # Custom JQL query
atl issue list --jql "sprint in openSprints() AND assignee = currentUser()"atl issue create --project PROJ --type Bug --summary "Title"
atl issue create --project PROJ --type Task --summary "Title" --description "Details"
atl issue create --project PROJ --parent PROJ-123 --summary "Subtask"atl issue edit PROJ-1234 --summary "New summary"
atl issue edit PROJ-1234 --description "New description content"
atl issue edit PROJ-1234 --description "Additional notes" --append # Append to existing
atl issue edit PROJ-1234 --assignee @me
atl issue edit PROJ-1234 --add-label bug --remove-label wontfix
atl issue edit PROJ-1234 --field "Story Points=8"
atl issue edit PROJ-1234 --field "Custom Field=Some **markdown** text" # Auto-converts to ADFNotes:
--appendpreserves existing description content (including embedded media) and adds new content at the end- Textarea custom fields automatically convert Markdown to ADF format
atl issue transition PROJ-1234 "In Progress"
atl issue transition PROJ-1234 --list # List available transitions
atl issue transition PROJ-1234 "Done" --field "Resolution=Fixed" # With required fieldsatl issue comment list PROJ-1234 # List comments
atl issue comment add PROJ-1234 --body "Comment" # Add comment
atl issue comment add PROJ-1234 --body-file msg.md # Add from file (avoids shell escaping)
atl issue comment edit PROJ-1234 --id 123 --body "Updated"
atl issue comment edit PROJ-1234 --id 123 --body-file msg.md
atl issue comment delete PROJ-1234 --id 123atl issue link PROJ-1234 PROJ-5678 # Link issues (default: Relates)
atl issue link PROJ-1234 PROJ-5678 --type Blocks # Link with specific typeatl issue weblink PROJ-1234 --url "https://..." --title "Title"atl issue sprint PROJ-1234 --sprint-id 123 # Move to sprint
atl issue sprint PROJ-1234 --backlog # Move to backlogatl issue attachment PROJ-1234 --list # List attachments
atl issue attachment PROJ-1234 --download <id> # Download attachmentatl issue types --project PROJ # List issue types
atl issue priorities # List available priorities
atl issue fields # List all fields
atl issue fields --search "story points" # Search for field by name
atl issue field-options --project PROJ --type Bug # Show allowed values for fields
atl issue field-options --project PROJ --type Bug --field "Priority" # Specific fieldatl board list # List all boards
atl board list --project PROJ # List boards for project
atl board rank PROJ-123 --before PROJ-456 # Rank issue before another
atl board rank PROJ-123 --after PROJ-456 # Rank issue after another
atl board rank PROJ-123 --top --board-id 42 # Move to top of backlogatl confluence space list # List spaces
atl confluence space list --json # List as JSONatl confluence page view <id> # View page by ID
atl confluence page view --space DOCS --title "Title"
atl confluence page list --space DOCS # List pages in space
atl confluence page list --space DOCS --status draft # List draft pages
atl confluence page list --space DOCS --status archived # List archived pages
atl confluence page search "query" # Search pages
atl confluence page children <id> # List child pages
atl confluence page create --space DOCS --title "New Page" --body "<p>Content</p>"
atl confluence page create --space DOCS --title "Draft" --draft # Create as draft
atl confluence page edit <id> --body "<p>New content</p>"
atl confluence page delete <id> # Delete page (prompts for confirmation)
atl confluence page delete <id> --force # Delete without confirmation
atl confluence page publish <id> # Publish a draft page
atl confluence page move <id> --target <parent-id>
atl confluence page archive <id> # Archive page (unarchive not supported via API)atl confluence template view <id> # View template
atl confluence template create --space DOCS --name "Name" --body "<html>"
atl confluence template update <id> --body "<html>"atl confluence page attachment <id> --list # List attachments
atl confluence page attachment <id> --list --json # List as JSON
atl confluence page attachment <id> --download --id <attID> # Download specific
atl confluence page attachment <id> --download-all # Download all
atl confluence page attachment <id> --download-all -o ./dir # Download to directory
atl confluence page attachment <id> --upload ./file.pdf # Upload file
atl confluence page attachment <id> --upload a.pdf --upload b.png # Upload multipleThe atl CLI accepts Markdown for descriptions AND comments, converting to Atlassian Document Format (ADF):
- Standard Markdown: headings, bold, italic, strikethrough, code, lists, links
- Blockquotes:
> text - Horizontal rules:
---or***or___ - GFM tables:
| Header | Header |with|---|---|separator - Panels:
:::info,:::warning,:::error,:::note,:::success - Expandable sections:
+++Title\ncontent\n+++ - Media references:
!media[attachment-id] - Mentions:
@[Display Name]or@[id:accountId]
Tip: Use --body-file for multi-line content to avoid shell escaping issues with backticks and special characters.
Confluence page bodies must be HTML with Confluence macros for code blocks:
<h1>Heading</h1>
<p>Paragraph with <strong>bold</strong> and <code>inline code</code>.</p>
<ul>
<li>Bullet item</li>
</ul>
<table>
<tr><th>Header</th></tr>
<tr><td>Cell</td></tr>
</table>For code blocks, use Confluence macro format:
<ac:structured-macro ac:name="code">
<ac:plain-text-body><![CDATA[your code here
multi-line code is preserved]]></ac:plain-text-body>
</ac:structured-macro>Important: The --body flag replaces the ENTIRE page content. View the page first with atl confluence page view <id> to understand its structure.
Use --json flag for structured output suitable for parsing:
# Get issue data as JSON
atl issue view PROJ-1234 --json | jq '.status'
# List issues and extract keys
atl issue list --assignee @me --json | jq '.[].key'
# Get page content
atl confluence page view 12345 --json | jq '.body'# Find the issue
atl issue list --jql "summary ~ 'login bug'" --json
# View details
atl issue view PROJ-1234
# Update it
atl issue edit PROJ-1234 --assignee @me
atl issue transition PROJ-1234 "In Progress"
atl issue comment PROJ-1234 --body "Starting work on this"# Create the issue
atl issue create --project PROJ --type Task --summary "Implement feature X"
# Link it to a parent story
atl issue link PROJ-1235 PROJ-1000 --type "is part of"# Find the page
atl confluence page search "API documentation" --json
# View current content
atl confluence page view 12345
# Update it
atl confluence page edit 12345 --body "<h1>Updated API Docs</h1><p>New content...</p>"The CLI returns non-zero exit codes on failure. Common errors:
- 401 Unauthorized: Run
atl auth loginto re-authenticate - 403 Forbidden: Check permissions for the resource
- 404 Not Found: Verify the issue key, page ID, or space key exists
- No automatic pagination for large result sets
- Rate limiting may apply for bulk operations
This section is for agents working on the atl codebase itself.
make build # Build to ./bin/atl
make install # Install to $GOPATH/bin
make test # Run tests
make lint # Run golangci-lint
make check # Run all checks (test + lint)
make clean # Remove build artifactsQuick build and run:
go build -o bin/atl ./cmd/atl
./bin/atl <command>cmd/atl/main.go # Entry point
internal/
api/ # Atlassian API clients
client.go # Base HTTP client with OAuth
jira.go # Jira API (issues, search, transitions, comments)
confluence.go # Confluence API (spaces, pages)
resources.go # Accessible resources discovery
auth/ # OAuth 2.0 flow and token management
oauth.go # OAuth flow with browser callback
token.go # Keyring-based token storage
browser.go # Browser launcher
cmd/ # Cobra command definitions
root.go # Root command, subcommand registration
auth/ # auth login|logout|status
issue/ # issue view|list|create|edit|transition|comment|assign
confluence/ # confluence space|page subcommands
board/ # board list|rank
config/ # config get|set|list|use-context|current-context|set-alias|delete-alias
config/ # Configuration management (~/.config/atlassian/)
iostreams/ # I/O abstraction for testability
output/ # Output formatting (JSON, tables, colors)
- Create file in appropriate
internal/cmd/<group>/directory - Define
*Optionsstruct withIO *iostreams.IOStreamsand flags - Create
NewCmd*function returning*cobra.Command - Define
*Outputstruct for JSON output with proper json tags - Implement
run*function that:- Creates API client via
api.NewClientFromConfig() - Calls API methods
- Outputs via
output.JSON()orfmt.Fprintf(opts.IO.Out, ...)
- Creates API client via
- Register in parent command's
NewCmd*function
Don't use cmd.MarkFlagRequired() - it produces unhelpful errors. Instead, validate in RunE with helpful messages:
RunE: func(cmd *cobra.Command, args []string) error {
if opts.Space == "" {
return fmt.Errorf("--space flag is required\n\nUse 'atl confluence space list' to see available spaces")
}
return runList(opts)
},client, err := api.NewClientFromConfig()
if err != nil {
return err
}
ctx := context.Background()
jira := api.NewJiraService(client)
// or
confluence := api.NewConfluenceService(client)All commands must support --json flag:
if opts.JSON {
return output.JSON(opts.IO.Out, outputStruct)
}
// Plain text output
fmt.Fprintf(opts.IO.Out, "Result: %s\n", value)OAuth 2.0 credentials can be configured two ways:
- Interactive setup:
atl auth setup- walks through creating OAuth app - Environment variables:
ATLASSIAN_CLIENT_IDandATLASSIAN_CLIENT_SECRET
Credentials stored in ~/.config/atlassian/config.yaml. Tokens stored in system keyring.