Agentik - a CLI-first, modular agent framework that runs LLMs via OpenRouter.
Project description
Agentik (A CLI‑First Modular Agent Framework)
Agentik is a developer‑friendly framework for building LLM agents that run via OpenRouter. It emphasizes: clean YAML configs, a batteries‑included CLI, pluggable tools with safety policies, rich JSONL transcripts, and a dev watcher for rapid inner‑loop iteration.
Table of Contents
-
CLI Reference (with Windows PowerShell and macOS/Linux examples)
- version, self-test, init
- new (agent|tool)
- template (list|apply|pull)
- run
- dev watch
- keys (set|show)
- models list
- tools (list|info|run)
- validate file
- batch run
- memory (init|recall|summarize|clear|path)
- eval run
- config path
Prerequisites
- Python 3.10+
Installation
Windows (PowerShell)
pip install agentik-framework
macOS/Linux
pip install agentik-framework
Configure OpenRouter
Agentik uses OpenRouter for LLM calls. Provide your key via env var or store it in Agentik’s RC.
Windows (PowerShell)
setx OPENROUTER_API_KEY "sk-or-XXXXXXXXXXXXXXXX"
# Close & reopen PowerShell so the env var is available in new sessions
macOS/Linux (bash/zsh)
echo 'export OPENROUTER_API_KEY="sk-or-XXXXXXXXXXXXXXXX"' >> ~/.bashrc
source ~/.bashrc # or: source ~/.zshrc
Store via Agentik RC (either scope):
agentik keys set openrouter sk-or-XXXXXXXXXXXXXXXX --global
# or
agentik keys set openrouter sk-or-XXXXXXXXXXXXXXXX --local
Verify Setup
Windows (PowerShell)
agentik self-test
agentik models list --filter gpt --refresh # optional
macOS/Linux
agentik self-test
agentik models list --filter gpt --refresh
Quick Start
- Initialize a project
PowerShell
mkdir my-agent; cd my-agent
agentik init . --template basic --name "My Agent Project"
macOS/Linux
mkdir my-agent && cd my-agent
agentik init . --template basic --name "My Agent Project"
- Scaffold an agent
PowerShell
agentik new agent research `
--template basic `
--tools http_fetch,html_to_text,write_file `
--with-tests `
--to .
macOS/Linux
agentik new agent research \
--template basic \
--tools http_fetch,html_to_text,write_file \
--with-tests \
--to .
- Minimal config (save as
agents/agent.yaml)
agent:
name: ResearchBot
goal: "Research and summarize information."
loop:
max_steps: 3
reflect: true
llm:
model: openai/gpt-4o-mini
temperature: 0.3
memory:
type: json
path: ./memory/research.json
policies:
allow_network: true
allow_filesystem: true
tools:
- http_fetch
- html_to_text
- write_file
- Run your agent
PowerShell
agentik run .\agents\agent.yaml `
-p "Summarize the main differences between GPT-4o and small LLMs in 5 bullets." `
--profile fast `
--stream `
--save-transcript .\runs\first-run.jsonl
macOS/Linux
agentik run ./agents/agent.yaml \
-p "Summarize the main differences between GPT-4o and small LLMs in 5 bullets." \
--profile fast \
--stream \
--save-transcript ./runs/first-run.jsonl
- Use the dev watcher (auto re‑run on save)
PowerShell tip: quote your globs (e.g.,
'**/*.py') so the shell doesn’t expand them.
PowerShell
agentik dev watch .\agents\agent.yaml `
--prompt "Summarize this project in 3 bullets." `
--path . `
--include '**/*.py' --include '**/*.yaml' --include 'templates/**' `
--exclude '.venv/**' --exclude 'runs/**' `
--save-transcripts .\runs `
--profile dev `
--stream
macOS/Linux
agentik dev watch ./agents/agent.yaml \
--prompt "Summarize this project in 3 bullets." \
--path . \
--include '**/*.py' --include '**/*.yaml' --include 'templates/**' \
--exclude '.venv/**' --exclude 'runs/**' \
--save-transcripts ./runs \
--profile dev \
--stream
Configuration Primer
-
YAML config defines the agent (goal, loop), LLM (model, temperature), memory store, policies, and tools.
-
Profiles (CLI
--profile) apply overrides:fast:{max_steps=2, reflect=false, temperature=0.2}thorough:{max_steps=6, reflect=true, temperature=0.3}deterministic:{temperature=0.0, reflect=false}creative:{temperature=0.9, reflect=false}cheap:{temperature=0.2}(keeps configured model)dev:{max_steps=3, reflect=false, temperature=0.3}
-
Precedence: YAML → RC/env → CLI overrides → profile overrides.
CLI Reference
Below, every command shows a signature and examples for Windows PowerShell and macOS/Linux.
Version & Environment
agentik version
Print CLI version.
PowerShell
agentik version
macOS/Linux
agentik version
agentik self-test
Show Python/OS info, OpenRouter key presence, and RC location.
PowerShell
agentik self-test
macOS/Linux
agentik self-test
Project Scaffolding
agentik init
agentik init [PATH] --template TEXT --force --name TEXT
PATHdefault.--templatedefaultbasic--forceoverwrite existing files--nameproject name override
PowerShell
agentik init . --template basic --name "Demo"
macOS/Linux
agentik init . --template basic --name "Demo"
agentik new agent
agentik new agent NAME \
--template TEXT \
--tools "t1,t2" \
--memory [dict|json] \
--memory-path PATH \
--to DIR \
--with-tests \
--force
PowerShell
agentik new agent helper `
--template basic `
--tools http_fetch,html_to_text `
--memory json `
--memory-path .\memory\agent.json `
--to . `
--with-tests `
--force
macOS/Linux
agentik new agent helper \
--template basic \
--tools http_fetch,html_to_text \
--memory json \
--memory-path ./memory/agent.json \
--to . \
--with-tests \
--force
agentik new tool
agentik new tool NAME --template [python] --to DIR --with-tests --force
PowerShell
agentik new tool web_fetcher --template python --to . --with-tests --force
macOS/Linux
agentik new tool web_fetcher --template python --to . --with-tests --force
Templates
agentik template list
List built‑ins.
PowerShell
agentik template list
macOS/Linux
agentik template list
agentik template apply
agentik template apply kind/name --to DIR --force --name TEXT
PowerShell
agentik template apply agent/basic --to . --force --name MyBot
macOS/Linux
agentik template apply agent/basic --to . --force --name MyBot
agentik template pull
Pull a git repo or zip into templates/third_party.
PowerShell
agentik template pull https://example.com/my-templates.zip --to .
macOS/Linux
agentik template pull https://example.com/my-templates.zip --to .
Running Agents
agentik run
agentik run CONFIG \
-p/--prompt TEXT \
--model TEXT \
--temperature FLOAT \
--stream \
--dry-run \
--save-transcript PATH \
--profile [fast|thorough|deterministic|creative|cheap|dev|none] \
--tag TAG (repeatable) \
--note TEXT \
--run-id TEXT \
--obs-max-chars INT
PowerShell
agentik run .\agents\agent.yaml `
-p "Five bullet summary of topic X" `
--profile fast `
--stream `
--save-transcript .\runs\out.jsonl
macOS/Linux
agentik run ./agents/agent.yaml \
-p "Five bullet summary of topic X" \
--profile fast \
--stream \
--save-transcript ./runs/out.jsonl
Developer Watch Mode
agentik dev watch
agentik dev watch CONFIG \
-p/--prompt TEXT \
--prompt-file PATH \
--path PATH # repeatable; default "." \
--include GLOB # repeatable; default ["**/*.py", "**/*.yml", "**/*.yaml", "**/*.json", "**/*.md", "templates/**", "tools/**"] \
--exclude GLOB # repeatable \
--interval FLOAT # default 0.6 \
--debounce FLOAT # default 0.5 \
--clear/--no-clear # default clear \
--stream/--no-stream # default stream \
--profile dev # default "dev" \
--save-transcripts DIR \
--obs-max-chars INT # default 800 \
--no-initial-run \
--tag TAG # repeatable; default ["dev"] \
--note TEXT
PowerShell
agentik dev watch .\agents\agent.yaml `
--prompt "Echo the date" `
--include '**/*.py' `
--exclude '.venv/**' `
--save-transcripts .\runs
macOS/Linux
agentik dev watch ./agents/agent.yaml \
--prompt "Echo the date" \
--include '**/*.py' \
--exclude '.venv/**' \
--save-transcripts ./runs
Keys & Models
agentik keys set openrouter
Store an API key in RC.
PowerShell
agentik keys set openrouter sk-or-... --global
# or
agentik keys set openrouter sk-or-... --local
macOS/Linux
agentik keys set openrouter sk-or-... --global
# or
agentik keys set openrouter sk-or-... --local
agentik keys show
Display masked key (env & RC) and RC scope/path.
PowerShell
agentik keys show
macOS/Linux
agentik keys show
agentik models list
List OpenRouter models (with optional cache bypass).
PowerShell
agentik models list --filter gpt --refresh
macOS/Linux
agentik models list --filter gpt --refresh
Tools (Discovery & Direct Runs)
agentik tools list
List discoverable tools.
PowerShell
agentik tools list
macOS/Linux
agentik tools list
agentik tools info NAME
Show class & description.
PowerShell
agentik tools info http_fetch
macOS/Linux
agentik tools info http_fetch
agentik tools run NAME
Call a tool directly (no agent loop). Values auto‑coerce: true/false → bool; 1→int; 1.2→float; else string. Quote values with spaces/HTML.
PowerShell
agentik tools run http_fetch --arg url=https://example.com --arg ttl=3600 --arg allow_network=true --json
agentik tools run html_to_text --arg "html=<p>Hello</p>" --arg keep_newlines=true --json
agentik tools run write_file --arg path=out\hello.txt --arg "content=Hello" --arg allow_filesystem=true --json
macOS/Linux
agentik tools run http_fetch --arg url=https://example.com --arg ttl=3600 --arg allow_network=true --json
agentik tools run html_to_text --arg 'html=<p>Hello</p>' --arg keep_newlines=true --json
agentik tools run write_file --arg path=out/hello.txt --arg 'content=Hello' --arg allow_filesystem=true --json
Validation & Batch
agentik validate file
Validate YAML; optionally print effective config after CLI overrides.
PowerShell
agentik validate file .\agents\agent.yaml `
--show-effective `
--model openai/gpt-4o-mini `
--temperature 0.2 `
--max-steps 2
macOS/Linux
agentik validate file ./agents/agent.yaml \
--show-effective \
--model openai/gpt-4o-mini \
--temperature 0.2 \
--max-steps 2
agentik batch run
Run prompts from CSV/JSONL and write JSONL results.
PowerShell
agentik batch run .\prompts.jsonl `
--column prompt `
--out .\results.jsonl `
--model openai/gpt-4o-mini `
--temperature 0.2
macOS/Linux
agentik batch run ./prompts.jsonl \
--column prompt \
--out ./results.jsonl \
--model openai/gpt-4o-mini \
--temperature 0.2
Memory Helpers
agentik memory init
Initialize store and add an initial record.
PowerShell
agentik memory init --type json --path .\memory\agentik.json
macOS/Linux
agentik memory init --type json --path ./memory/agentik.json
agentik memory recall
PowerShell
agentik memory recall --n 10 --config .\agents\agent.yaml
macOS/Linux
agentik memory recall --n 10 --config ./agents/agent.yaml
agentik memory summarize
PowerShell
agentik memory summarize --n 20 --max-chars 1200 --config .\agents\agent.yaml
macOS/Linux
agentik memory summarize --n 20 --max-chars 1200 --config ./agents/agent.yaml
agentik memory clear
PowerShell
agentik memory clear --config .\agents\agent.yaml
macOS/Linux
agentik memory clear --config ./agents/agent.yaml
agentik memory path
PowerShell
agentik memory path --config .\agents\agent.yaml
macOS/Linux
agentik memory path --config ./agents/agent.yaml
Lightweight Eval Harness
agentik eval run
Each JSONL line should have prompt, and optional expect_contains[] and/or expect_regex.
PowerShell
agentik eval run .\tests.jsonl --config .\agents\agent.yaml --out .\eval_results.jsonl
macOS/Linux
agentik eval run ./tests.jsonl --config ./agents/agent.yaml --out ./eval_results.jsonl
Config Helpers
agentik config path
Show the .agentikrc path for a scope.
PowerShell
agentik config path --global
agentik config path --local
macOS/Linux
agentik config path --global
agentik config path --local
Built‑in Tools & Policies
Selected built‑ins:
http_fetch(url, ttl, timeout, max_bytes, headers, allow_network)→{ok, data, error, meta}(data.text,data.status, cache info)html_to_text(html, keep_newlines, drop_links, max_chars)→ plaintextwrite_file(path, content, encoding, overwrite, allow_abs, allow_filesystem)→ safe file writer
Policies are enforced by config:
policies:
allow_network: true | false
allow_filesystem: true | false
If a tool requires a disabled capability, the call is blocked and recorded in observations/transcripts.
Transcripts & Cost Estimation
Add --save-transcript PATH (single run) or --save-transcripts DIR (dev watch) to write JSONL transcripts. Summaries include steps, token counts, timings, and cost if available.
Optional pricing overrides (USD / 1K tokens):
PowerShell
$env:AGENTIK_PRICE_PROMPT_PER_1K = "0.50"
$env:AGENTIK_PRICE_COMPLETION_PER_1K = "1.50"
macOS/Linux
export AGENTIK_PRICE_PROMPT_PER_1K="0.50"
export AGENTIK_PRICE_COMPLETION_PER_1K="1.50"
Quick Reference Table
| Area | Command | Key Options | ||||
|---|---|---|---|---|---|---|
| Version | agentik version |
– | ||||
| Self‑test | agentik self-test |
– | ||||
| Init | agentik init [PATH] |
--template, --force, --name |
||||
| Run | agentik run CONFIG |
-p, --model, --temperature, --stream, --dry-run, --save-transcript, --profile, --tag, --note, --run-id, --obs-max-chars |
||||
| Keys | agentik keys set openrouter |
--global or --local |
||||
| Keys | agentik keys show |
– | ||||
| Models | agentik models list |
--filter, --refresh |
||||
| New | agentik new agent NAME |
--template, --tools, --memory, --memory-path, --to, --with-tests, --force |
||||
| New | agentik new tool NAME |
--template, --to, --with-tests, --force |
||||
| Templates | agentik template list/apply/pull |
as above | ||||
| Tools | agentik tools list/info/run |
--arg, --json |
||||
| Validate | agentik validate file CONFIG |
--show-effective, --model, --temperature, --max-steps |
||||
| Batch | agentik batch run FILE |
--column, --out, --model, --temperature |
||||
| Memory | agentik memory {init recall summarize clear path} |
see above | ||||
| Eval | agentik eval run FILE.jsonl |
--config, --out |
||||
| Dev | agentik dev watch CONFIG |
-p/--prompt-file, --path, --include, --exclude, --interval, --debounce, --clear, --stream, --profile, --save-transcripts, --obs-max-chars, --no-initial-run, --tag, --note |
||||
| Config | agentik config path |
--global or --local |
You’re set. Keep this open while you iterate; pair it with agentik dev watch for the fastest edit‑run loop.
Troubleshooting
-
“Network error talking to OpenRouter.” Confirm your key in the current shell:
- PowerShell:
echo $env:OPENROUTER_API_KEY - macOS/Linux:
echo $OPENROUTER_API_KEYThen try:agentik models list --refresh. Behind a proxy? SetHTTP_PROXY/HTTPS_PROXY.
- PowerShell:
-
Dev watcher: “unexpected extra arguments …”
- Quote globs in PowerShell:
--include '**/*.py'(single quotes).
- Quote globs in PowerShell:
-
Auth error / missing key: set
OPENROUTER_API_KEYor runagentik keys set openrouter .... -
Rate limited: add delays, batch, or upgrade your OpenRouter plan.
-
Network error: check connectivity or proxy settings (
HTTP_PROXY,HTTPS_PROXY). -
PowerShell globbing: quote globs, e.g.
--include '**/*.py'.
Development
- Lint/format:
ruff check .andblack . - Tests:
pytest -q
Happy building with Agentik!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentik_framework-1.1.5.tar.gz.
File metadata
- Download URL: agentik_framework-1.1.5.tar.gz
- Upload date:
- Size: 50.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d2fd66aee26199da2c4d20e15a656b2846dee9f50b68f12b1972759f7c801db
|
|
| MD5 |
6226a753abebbe9d70ac4b0d97950c49
|
|
| BLAKE2b-256 |
6e96d589ea3302657a350fc388a27b799cf8bea15aeeca2068e74e45304f5b64
|
File details
Details for the file agentik_framework-1.1.5-py3-none-any.whl.
File metadata
- Download URL: agentik_framework-1.1.5-py3-none-any.whl
- Upload date:
- Size: 52.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a42c53c07179927ad900a0736f1767e2b0e9c747e739c50fb54f4ca8b60cee8e
|
|
| MD5 |
22b6f7d1e78ebb110a4a83a7809dd8c7
|
|
| BLAKE2b-256 |
f001be41734d1b92fd93c967b29b7257b257f362b7158f0247e070b9db82dad0
|