Configure DMTools to work with your Jira, Confluence, Figma, GitHub, and AI providers.
DMTools uses environment variables for configuration. The easiest way is to use .env files.
# Create a dmtools.env file in your project directory
touch dmtools.env
chmod 600 dmtools.env # Secure the fileEdit dmtools.env with your favorite editor:
# Jira Configuration
JIRA_BASE_PATH=https://your-company.atlassian.net
JIRA_EMAIL=your-email@company.com
JIRA_API_TOKEN=ATATT3xFfGF0T...
# Confluence Configuration
CONFLUENCE_BASE_PATH=https://your-company.atlassian.net/wiki
CONFLUENCE_EMAIL=your-email@company.com
CONFLUENCE_API_TOKEN=ATATT3xFfGF0T...
CONFLUENCE_DEFAULT_SPACE=YOURSPACE
# AI Provider (Gemini recommended)
GEMINI_API_KEY=AIza...
# Optional: GitHub for source code operations
GITHUB_TOKEN=ghp_...# Test Jira connection
dmtools jira_get_ticket YOUR-123
# Test Confluence connection
dmtools confluence_content_by_title "Test Page"DMTools loads environment variables from multiple files in this order (first found wins):
.env(current directory) - highest prioritydmtools.env(current directory)dmtools-local.env(current directory) - for personal overrides.env(script directory)dmtools.env(script directory)dmtools-local.env(script directory) - lowest priority
Tip: Use dmtools.env for shared team configuration and dmtools-local.env for your personal overrides.
| Variable | Description | Example |
|---|---|---|
JIRA_BASE_PATH |
Your Jira instance URL | https://company.atlassian.net |
JIRA_EMAIL |
Your Jira email | user@company.com |
JIRA_API_TOKEN |
Jira API token | ATATT3xFfGF0T... |
JIRA_AUTH_TYPE |
Authentication type | Basic (default) or Bearer |
How to get Jira API Token:
- Go to https://id.atlassian.com/manage-profile/security/api-tokens
- Click "Create API token"
- Give it a label (e.g., "DMTools")
- Copy the token
| Variable | Description | Example |
|---|---|---|
CONFLUENCE_BASE_PATH |
Confluence URL | https://company.atlassian.net/wiki |
CONFLUENCE_EMAIL |
Your Confluence email | user@company.com |
CONFLUENCE_API_TOKEN |
Confluence API token | ATATT3xFfGF0T... |
CONFLUENCE_DEFAULT_SPACE |
Default space key | TEAM |
CONFLUENCE_AUTH_TYPE |
Authentication type | Basic (default) |
How to get Confluence API Token:
- Same as Jira (Atlassian uses unified tokens)
- You can use the same token for both Jira and Confluence
Google Gemini (Recommended):
GEMINI_API_KEY=AIza...
GEMINI_DEFAULT_MODEL=gemini-1.5-pro
GEMINI_BASE_PATH=https://generativelanguage.googleapis.com/v1betaHow to get Gemini API Key:
- Go to https://aistudio.google.com/app/apikey
- Click "Create API key"
- Copy the key (starts with
AIza)
OpenAI:
OPEN_AI_API_KEY=sk-...
OPEN_AI_MODEL=gpt-4o
OPEN_AI_BATH_PATH=https://api.openai.com/v1How to get OpenAI API Key:
- Go to https://platform.openai.com/api-keys
- Click "Create new secret key"
- Copy the key (starts with
sk-)
SOURCE_GITHUB_TOKEN=ghp_...
SOURCE_GITHUB_WORKSPACE=your-org
SOURCE_GITHUB_REPOSITORY=your-repo
SOURCE_GITHUB_BRANCH=main
SOURCE_GITHUB_BASE_PATH=https://api.github.comHow to get GitHub Token:
- Go to https://github.com/settings/tokens
- Generate new token (classic)
- Select scopes:
repo,read:org,read:user - Copy the token (starts with
ghp_)
GITLAB_TOKEN=glpat-...
GITLAB_WORKSPACE=your-group
GITLAB_REPOSITORY=your-repo
GITLAB_BRANCH=main
GITLAB_BASE_PATH=https://gitlab.com/api/v4BITBUCKET_TOKEN=Bearer your-token
BITBUCKET_API_VERSION=V2
BITBUCKET_WORKSPACE=your-workspace
BITBUCKET_REPOSITORY=your-repo
BITBUCKET_BRANCH=main
BITBUCKET_BASE_PATH=https://api.bitbucket.orgFIGMA_TOKEN=figd_...
FIGMA_BASE_PATH=https://api.figma.com/v1How to get Figma Token:
- Go to https://www.figma.com/settings (Personal Access Tokens section)
- Click "Create new token"
- Copy the token (starts with
figd_)
# Delay between API requests (milliseconds)
SLEEP_TIME_REQUEST=300
# Maximum search results from Jira
JIRA_MAX_SEARCH_RESULTS=1000
# Clear Jira cache on startup
JIRA_CLEAR_CACHE=true
# Enable detailed Jira logging
JIRA_LOGGING_ENABLED=true# AI retry settings
AI_RETRY_AMOUNT=3
AI_RETRY_DELAY_STEP=20000
# Model selection for specific tasks
CODE_AI_MODEL=gpt-4o
TEST_AI_MODEL=gpt-4o
# Prompt chunk configuration
PROMPT_CHUNK_TOKEN_LIMIT=4000
PROMPT_CHUNK_MAX_SINGLE_FILE_SIZE_MB=4
PROMPT_CHUNK_MAX_TOTAL_FILES_SIZE_MB=4
PROMPT_CHUNK_MAX_FILES=10Limit which integrations are loaded (improves startup time):
DMTOOLS_INTEGRATIONS="jira,confluence,figma,ai"Available integrations: jira, confluence, figma, github, gitlab, bitbucket, ai, cli, file
Set secrets and variables in your repository:
Secrets (Settings > Secrets and variables > Actions):
JIRA_EMAIL
JIRA_API_TOKEN
CONFLUENCE_EMAIL
CONFLUENCE_API_TOKEN
GEMINI_API_KEY
FIGMA_TOKEN
GITHUB_TOKEN (usually auto-provided)
Variables (Settings > Secrets and variables > Actions):
JIRA_BASE_PATH
JIRA_AUTH_TYPE
CONFLUENCE_BASE_PATH
CONFLUENCE_DEFAULT_SPACE
In workflow file:
- name: Run DMTools
env:
JIRA_EMAIL: ${{ secrets.JIRA_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
JIRA_BASE_PATH: ${{ vars.JIRA_BASE_PATH }}
JIRA_AUTH_TYPE: ${{ vars.JIRA_AUTH_TYPE }}
run: dmtools jira_get_ticket PROJ-123Add variables in Settings > CI/CD > Variables:
JIRA_EMAIL
JIRA_API_TOKEN
JIRA_BASE_PATH
GEMINI_API_KEY
In .gitlab-ci.yml:
script:
- export JIRA_EMAIL="$JIRA_EMAIL"
- export JIRA_API_TOKEN="$JIRA_API_TOKEN"
- dmtools jira_get_ticket PROJ-123# Secure your configuration files
chmod 600 dmtools.env
chmod 600 dmtools-local.env
chmod 600 .envEnsure environment files are ignored by Git:
# Check if .gitignore includes environment files
cat .gitignore | grep -E "\.env|dmtools.env"
# Add to .gitignore if missing
cat >> .gitignore << EOF
.env
dmtools.env
dmtools-local.env
*.env.local
EOF- Rotate tokens regularly (every 90 days recommended)
- Use different tokens for development vs production
- Revoke old tokens after rotation
For production:
- Use GitHub Secrets / GitLab Variables
- Use AWS Secrets Manager / Azure Key Vault
- Use HashiCorp Vault for enterprise environments
# Check file permissions
ls -la dmtools.env
# Check file format (no spaces around =)
cat dmtools.env | grep "="
# Check for hidden characters
cat -A dmtools.envJira/Confluence:
# Test token validity
curl -u "your-email@company.com:YOUR_TOKEN" \
https://your-company.atlassian.net/rest/api/3/myself
# Should return your user info if token is validGemini:
# Test API key
curl "https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_KEY"
# Should return list of available models# Jira Cloud (correct)
JIRA_BASE_PATH=https://your-company.atlassian.net
# Jira Server/Data Center (correct)
JIRA_BASE_PATH=https://jira.your-company.com
# Incorrect (don't include /rest/api)
JIRA_BASE_PATH=https://your-company.atlassian.net/rest/api/3 # βHere's a complete example configuration file:
# dmtools.env - Complete Example Configuration
# ============================================
# Jira Configuration
# ============================================
JIRA_BASE_PATH=https://mycompany.atlassian.net
JIRA_EMAIL=john.doe@mycompany.com
JIRA_API_TOKEN=ATATT3xFfGF0T1234567890abcdefghijklmnop
JIRA_AUTH_TYPE=Basic
JIRA_MAX_SEARCH_RESULTS=1000
JIRA_LOGGING_ENABLED=false
JIRA_CLEAR_CACHE=false
# ============================================
# Confluence Configuration
# ============================================
CONFLUENCE_BASE_PATH=https://mycompany.atlassian.net/wiki
CONFLUENCE_EMAIL=john.doe@mycompany.com
CONFLUENCE_API_TOKEN=ATATT3xFfGF0T1234567890abcdefghijklmnop
CONFLUENCE_DEFAULT_SPACE=ENG
CONFLUENCE_AUTH_TYPE=Basic
# ============================================
# AI Provider (Gemini)
# ============================================
GEMINI_API_KEY=AIzaSyD1234567890abcdefghijklmnopqrstuvwxyz
GEMINI_DEFAULT_MODEL=gemini-1.5-pro
GEMINI_BASE_PATH=https://generativelanguage.googleapis.com/v1beta
# ============================================
# GitHub Integration
# ============================================
SOURCE_GITHUB_TOKEN=ghp_1234567890abcdefghijklmnopqrstuvwxyz
SOURCE_GITHUB_WORKSPACE=mycompany
SOURCE_GITHUB_REPOSITORY=myproject
SOURCE_GITHUB_BRANCH=main
SOURCE_GITHUB_BASE_PATH=https://api.github.com
# ============================================
# Figma Integration
# ============================================
FIGMA_TOKEN=figd_1234567890abcdefghijklmnopqrstuvwxyz
FIGMA_BASE_PATH=https://api.figma.com/v1
# ============================================
# Performance & Behavior
# ============================================
SLEEP_TIME_REQUEST=300
DMTOOLS_INTEGRATIONS=jira,confluence,figma,ai,githubβ Configuration complete! Now you're ready to use DMTools:
π First Steps - Run your first commands
π MCP Tools Reference - Learn the command structure
π MCP Tools - Explore all 67 available tools
For more detailed information, see:
- First Steps - Start using DMTools CLI
- MCP Tools - Available CLI tools