Skip to content

jtk auth

jtk supports two authentication methods:

  1. Environment variables (recommended for CI/CD and MCP servers)
  2. Interactive login (stores credentials locally)

Environment variables take priority over stored credentials.

Set these environment variables to authenticate without running jtk auth:

VariableDescriptionExample
JIRA_DOMAINYour Atlassian site subdomainmycompany (for mycompany.atlassian.net)
JIRA_EMAILYour Atlassian email addressjane@example.com
JIRA_API_TOKENAPI token from AtlassianATATT3xFf...
JIRA_TOKEN_TYPEOptional. classic or scopedclassic
Terminal window
export JIRA_DOMAIN="mycompany"
export JIRA_EMAIL="jane@example.com"
export JIRA_API_TOKEN="your-api-token"

When configuring jtk as an MCP server (e.g., in Claude Desktop, opencode, or Cursor), pass credentials as environment variables:

{
"jtk": {
"type": "local",
"command": ["/path/to/jtk", "mcp"],
"environment": {
"JIRA_DOMAIN": "mycompany",
"JIRA_EMAIL": "jane@example.com",
"JIRA_API_TOKEN": "your-api-token"
}
}
}

Interactive login that prompts for your Jira domain, email, and API token. Credentials are saved to ~/.config/jtk/credentials.json.

Terminal window
jtk auth
Enter your Jira domain (e.g., 'mycompany' for mycompany.atlassian.net): mycompany
Enter your Atlassian email: jane@example.com
Enter your API token: ****
Authenticating...
Authentication successful! Credentials saved.

jtk automatically detects whether your token is a classic API token or a scoped/fine-grained token and configures auth accordingly.

Shows the current authentication status, including which method is active.

Terminal window
jtk status

With environment variables:

Authenticated via environment variables
Domain: mycompany.atlassian.net
Email: jane@example.com

With stored credentials:

Authenticated via stored credentials
Domain: mycompany.atlassian.net
Email: jane@example.com
Token: ATAT...61F3
Saved: 2025-01-15 09:30:00
File: /home/jane/.config/jtk/credentials.json

Removes stored credentials from disk.

Terminal window
jtk logout
Logged out. Credentials removed.

jtk supports both Atlassian token types:

TypeAuth MethodBase URLHow to Identify
ClassicBasic Auth (email:token)https://{domain}.atlassian.net/rest/api/3Created at id.atlassian.com
ScopedBasic Auth (email:token)https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3Created via developer console with granular permissions

jtk auto-detects the token type by probing both auth methods at startup. You can also set JIRA_TOKEN_TYPE=classic or JIRA_TOKEN_TYPE=scoped to skip auto-detection.