This structure is a convention, not a requirement. You can organize your code however you like as long as the entry point is specified in klisk.config.yaml.
from klisk import define_agent, get_toolsagent = define_agent( name="Assistant", instructions="You are a helpful assistant. Use the tools available to help the user.", model="gpt-5.2", tools=get_tools("greet"),)
Klisk automatically discovers all define_agent() calls in your entry file and registers them. You can define multiple agents in a single file or split them across modules.
from klisk import define_agent, get_toolsresearcher = define_agent( name="Researcher", model="gpt-5.2", tools=get_tools("web_search"), builtin_tools=["web_search"],)writer = define_agent( name="Writer", model="anthropic/claude-sonnet-4-5", instructions="You are a professional writer.",)
All agent definitions must be imported into the entry file (directly or indirectly) to be discovered by Klisk.
Store API keys and secrets in a .env file at the project root:
.env
OPENAI_API_KEY=sk-your-key-here# Uncomment and fill in the API key for your chosen provider:# ANTHROPIC_API_KEY=sk-ant-your-key-here# GEMINI_API_KEY=your-key-here# MISTRAL_API_KEY=your-key-here
Klisk loads this file automatically when you run klisk dev or klisk run:
# From watcher.pydef _is_relevant(path: str) -> bool: p = Path(path) parts = p.parts if any(part.startswith(".") or part == "__pycache__" or part == "node_modules" or part == ".venv" for part in parts): return False return p.suffix in {".py", ".yaml", ".yml"}
You can work with multiple projects in a workspace:
# Create multiple projectsklisk create researcherklisk create writerklisk create coordinator# Launch Studio for all projectsklisk dev# The Studio lists all agents from all projects# Each agent is prefixed with its project name:# - researcher/Researcher# - writer/Writer# - coordinator/Coordinator
In workspace mode, agent and tool names are prefixed with the project name to avoid collisions (e.g., researcher/search vs writer/search).