Jatin Bansal@blog:~/notes$ open claude-code-commands
A comprehensive guide to essential Claude Code CLI commands for efficient AI-powered development workflows, with special focus on Docker MCP Gateway integration.
Docker MCP Gateway Management
I prefer to use MCP servers through the Docker MCP Gateway. It provides a unified way for managing MCP servers across different tools like Cursor, Claude, and other AI clients without manual configuration for each tool.
# Run gateway with security features enableddocker mcp gateway run \
--verify-signatures \
--log-calls \
--block-secrets
# Run gateway with specific servers and transportdocker mcp gateway run \
--transport=sse \
--servers=wikipedia-mcp \
--tools=get_article,get_summary,get_related_topics
# Servers I have currently enabled docker mcp server list
# context7, docker, duckduckgo, fetch, filesystem, sequentialthinking, time
Server Catalog Management
bash
1
2
3
4
5
6
7
8
# View available MCP servers in catalogdocker mcp catalog show
# Enable specific serversdocker mcp server enable google-maps brave
# Disable serversdocker mcp server disable <server-name>
Secret and Configuration Management
bash
1
2
3
4
5
6
# Set API keys and secretsdocker mcp secret set'brave.api_key=YOUR_API_KEY'docker mcp secret set'github.token=YOUR_GITHUB_TOKEN'# View current configurationdocker mcp config read
Gateway Security Features
Container Isolation: Each MCP server runs in isolated Docker containers
Signature Verification: Verify provenance of MCP container images
Secret Scanning: Block secrets in inbound/outbound payloads
Network Restrictions: Controlled network access for servers
Resource Limits: CPU and memory constraints per server
Traditional MCP Server Management
List MCP Servers
shell
1
claude mcp list
Purpose: Display all configured MCP (Model Context Protocol) servers and their status.
Add MCP Servers from Claude Desktop
shell
1
claude mcp add-from-claude-desktop -s user
Purpose: Import MCP server configurations from Claude Desktop application to Claude Code CLI.
Purpose: Display detailed information about a specific MCP server configuration.
Output Formats & Scripting
JSON Output for Automation
bash
1
2
3
4
5
6
7
8
# Get structured JSON responseclaude -p "analyze this code" --output-format json
# Stream JSON for real-time processingclaude "process large dataset" --output-format stream-json
# Combine with jq for parsingclaude -p "list project dependencies" --output-format json | jq '.content'
Scripting Examples
bash
1
2
3
# Automated code reviewclaude -p "review changes in $(git diff --name-only)" > review.md
git diff | claude "review these changes" -p
Configuration & Settings
View Settings File
shell
1
cat ~/.claude/settings.json
response:
json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{"permissions":{"allow":["mcp__DOCKER__get-library-docs","mcp__DOCKER__resolve-library-id","mcp__DOCKER__sequentialthinking","mcp__DOCKER__fetch","mcp__DOCKER__search","WebFetch(domain:docs.anthropic.com)","WebFetch(domain:*)","Bash(npm run lint)","mcp__DOCKER__fetch_content","mcp__DOCKER__list_directory","mcp__DOCKER__read_multiple_files","mcp__DOCKER__read_file"],"deny":[]}}
Purpose: Display current Claude Code configuration including MCP servers, shortcuts, and allowed tools. I use this configuration to auto allow of these tools
Session Management
Start Interactive Session
shell
1
claude chat
Purpose: Begin a new interactive conversation with Claude.
Resume Previous Session
shell
1
2
3
claude --resume
# orclaude -c
Purpose: Continue from your last conversation session.
Enhanced Development Workflow
Model Selection & Performance
shell
1
2
3
4
5
6
7
8
# Use specific modelclaude --model claude-3-7-sonnet-latest
claude --model claude-3-5-sonnet-20241022
claude --model claude-3-5-haiku-20241022
# Model comparison workflowclaude --model claude-3-5-sonnet-20241022 "complex analysis task"claude --model claude-3-5-haiku-20241022 "simple quick task"
Advanced Command Execution
shell
1
2
3
4
5
6
7
8
9
# Single command with print flagclaude "your prompt here" -p
claude "your prompt here" --print
# Continue conversation from commandclaude -c "follow up question"# Verbose execution for debuggingclaude --debug "debug this issue"
File and Directory Operations
shell
1
2
3
4
5
6
7
8
9
10
11
# Add multiple directories to contextclaude --add-dir /path/to/src --add-dir /path/to/tests
# Process file inputclaude < analysis-prompt.txt
# Save formatted outputclaude "generate report" -p --output-format json > report.json
# Pipe operationsgit diff | claude "review these changes" -p
# Run long tasks in backgroundclaude "analyze large codebase"&# output:- [1] pidps pid
Performance Optimization
bash
1
2
3
4
5
6
# Use faster model for simple tasksclaude --model claude-3-5-haiku-20241022 "quick syntax check"# Cache frequently used promptsecho"Review code for security vulnerabilities" > security-review.prompt
claude < security-review.prompt
Debug MCP Issues
shell
1
claude --debug mcp list
Troubleshooting & Performance Tips
Common Issues & Solutions
MCP Server Connection Problems
bash
1
2
# Check server statusclaude mcp list --debug
Performance Optimization Tips
Choose Right Model: Use Haiku for simple tasks, Sonnet for complex analysis
Cache Prompts: Save frequently used prompts to files
Batch Operations: Group related tasks together
Clean Sessions: Regularly remove old conversation history
# Essential commandsclaude --help # Get helpclaude chat # Start interactive sessionclaude -p "query"# One-time queryclaude --resume # Resume last session# MCP managementclaude mcp list # List serversclaude mcp add <name> <cmd> # Add serverclaude mcp get <name> # Server detailsclaude mcp remove <name> # Remove server# Docker Gatewaydocker mcp gateway run # Start gatewaydocker mcp catalog show # Browse catalogdocker mcp server enable <name> # Enable serverdocker mcp secret set'key=val'# Set secrets
This comprehensive reference covers Claude Code CLI usage with special focus on Docker MCP Gateway integration. For the latest features and updates, always refer to claude --help or the official documentation ↗.