Getting Started with Gladex

5-minute setup to your first AI workflow.

Prerequisites

1. Install Gladex

# The published binary — the same file the Download page serves
curl -fsSL https://gladex.de/download/gladex -o /usr/local/bin/gladex
chmod +x /usr/local/bin/gladex

# Or build from source
git clone git://git.gladex.de/gladex.git
cd gladex/app/src/go
./build.sh
# Binary outputs to ./gladex

2. Initialize a Workspace

mkdir my-project && cd my-project
gladex init

This creates:

.gladex/
├── config.json       # Workspace configuration
├── context.db        # SQLite database (contexts, workflows, trust_scores)
└── contexts/         # Context file storage

3. Push Your First Context

Contexts are named collections of text (code, docs, configs) that AI tools can use.

# Seed the sample files this section pushes — a fresh workspace has none yet
mkdir -p src/app config
printf 'package main\n\nfunc main() {}\n' > src/app/main.go
printf '{\n  "name": "my-project"\n}\n' > config/app.json

# Push from files
gladex context push backend ./src/**/*.go

# Push from stdin (pipe)
echo "System prompt: You are a helpful Go developer." | gladex context push system-prompt

# Push a config file
gladex context push config ./config/*.json

Note the double-star glob above: the shell expands these paths (plain bash without globstar treats a double star like a single star), so that path reaches one directory level down — which is why the sample file sits in src/app/.

4. List and Retrieve Contexts

# List all stored contexts
gladex context list

# Pull a context (with header/footer)
gladex context pull backend

# Pull raw content only
gladex context pull backend --raw

5. Create and Run a Workflow

Workflows are JSON files that chain context loading, shell commands, and variable interpolation.

Every step needs a name — printed in the run output and keyed on by error messages — plus a config object holding that step's own settings. The validator requires both, and create runs it for you before anything is saved.

# Create a workflow definition
cat > review.json << 'EOF'
{
  "name": "code-review",
  "description": "Review code with context",
  "steps": [
    {"type": "context", "name": "backend", "config": {"context_name": "backend"}},
    {"type": "set-var", "name": "task", "config": {"var": "task", "value": "Review for security issues"}},
    {"type": "print", "name": "show-task", "config": {"message": "Reviewing: {{.task}}"}},
    {"type": "shell", "name": "analysis", "config": {"command": "echo 'Running static analysis...'"}},
    {"type": "context", "name": "system-prompt", "config": {"context_name": "system-prompt"}}
  ]
}
EOF

# Store the workflow
gladex workflow create code-review --from review.json

# Execute with dry-run first
gladex workflow run code-review --dry-run

# Run for real — a shell step is refused unless you ask for it explicitly
gladex workflow run code-review --allow-shell

# Check run history
gladex workflow runs code-review

6. Record Trust Scores

Track which AI suggestions you accept or reject to build trust scores over time.

# Record suggestion outcomes
gladex trust record copilot context-optimization accepted
gladex trust record cursor api-refactor rejected
gladex trust record claude security-fix partial

# Check scores
gladex trust list

# Get human-readable confidence
gladex trust confidence copilot context-optimization
# → HIGH — copilot's suggestions on context-optimization are reliable

7. Start the HTTP Server

If you want to access Gladex via HTTP (for scripts or other tools):

# Start the context server
gladex serve --port 50051

# The server exposes:
# GET  /healthz           — Health check
# GET  /api/contexts      — List contexts
# POST /api/contexts      — Create/update context
# GET  /api/workflows     — List workflows
# POST /api/workflows/:name/run — Execute workflow

8. Connect AI Tools via MCP

Gladex implements the Model Context Protocol (MCP) so AI coding assistants can use it directly.

# Start MCP server
gladex mcp --port 50052

# Or use stdio transport (for local integration)
gladex mcp --stdio

The MCP server exposes 7 tools:

Next Steps

Troubleshooting

"No workspace found"

Run gladex init in your project directory first.

"Context not found"

Check gladex context list to see stored contexts.

"Workflow validation failed"

Use gladex workflow validate --from workflow.json to check your JSON syntax.

"MCP server not connecting"

Ensure port 50052 is not in use, or specify a different port with --port.

Example: Complete Developer Workflow

# 1. Set up your workspace
mkdir ai-workspace && cd ai-workspace
gladex init

# Sample files the three pushes below read (a fresh workspace has none)
mkdir -p src/app docs
printf 'package main\n\nfunc main() {}\n' > src/app/main.go
printf 'export const App = () => null;\n' > src/app/App.tsx
printf '.app { display: block; }\n' > src/app/styles.css
printf '# Sample project docs\n' > docs/guide.md

# 2. Store your project context
gladex context push frontend ./src/**/*.tsx ./src/**/*.css
gladex context push backend ./src/**/*.go
gladex context push docs ./docs/*.md

# 3. Create a code review workflow
cat > review-all.json << 'EOF'
{
  "name": "review-all",
  "description": "Review all components",
  "steps": [
    {"type": "print", "name": "start", "config": {"message": "Starting full code review..."}},
    {"type": "context", "name": "load-docs", "config": {"context_name": "docs"}},
    {"type": "context", "name": "load-backend", "config": {"context_name": "backend"}},
    {"type": "shell", "name": "review-backend", "config": {"command": "echo 'Reviewing backend...'"}},
    {"type": "context", "name": "load-frontend", "config": {"context_name": "frontend"}},
    {"type": "shell", "name": "review-frontend", "config": {"command": "echo 'Reviewing frontend...'"}},
    {"type": "print", "name": "done", "config": {"message": "Review complete."}}
  ]
}
EOF

gladex workflow create review-all --from review-all.json

# 4. Run it (shell steps need --allow-shell)
gladex workflow run review-all --allow-shell

# 5. Start the server for other tools
gladex serve &

# 6. Connect your AI assistant via MCP
gladex mcp --port 50052 &

Resources


Gladex — Unified AI Developer Workspace