A command-line tool for interacting with the GenAI infrastructure. It allows you to:
- Register users
- Create, register, and manage agents
- Run agents in isolated environments
-
Run the install script:
./install_cli.sh
-
Enter your system password when prompted — this installs the binary to
/usr/local/bin. -
Verify installation:
genai --help
You should see a help message with available commands:
Usage: genai [OPTIONS] COMMAND [ARGS]... ... Commands: login signup logout list_agents register_agent delete_agent generate_agent run_agents
-
Set the GitHub token as a user environment variable in PowerShell:
[Environment]::SetEnvironmentVariable("GITHUB_TOKEN", "your_token_here", "User")
-
Install the CLI:
.\install_cli.ps1
-
Use the CLI:
.\genai.exe --help
Note: This will change after the repo becomes public.
-
Run the build script:
./build_cli.sh
-
Or build manually:
-
Ensure
python3.12anduvare installed. -
Run:
uv run pyinstaller --onefile --name genai.bin cli.py
-
-
Build using:
./build_cli.ps1This uses Nuitka to compile into a Windows-friendly executable that avoids malware flags.
-
If you already have a GenAI account (from front-end or back-end):
genai login -u <your_username> -p <your_password>
-
First-time users:
genai signup -u <new_username>
-
GenAI CLI stores your JWT token in
~/.genai/credentialsand uses it for agent-related operations.
⚠️ You must be logged in to use agent-related commands.
- Python syntax must be valid.
- Agent structure should follow GenAI conventions.
- All dependencies should be installed in the agent’s virtual environment.
-
Ensure you're logged in.
-
Run:
genai register_agent --name my_cool_agent --description "This agent does something awesome" -
This will:
- Register metadata in the backend
- Create a Python file in
agents/ - Assign a JWT to the agent (stored in the file)
🚫 Do not modify the JWT — it's used to validate your agent.
-
Go to the agent directory:
cd agents/my_cool_agent -
Create a virtual environment:
uv venv uv sync
You can also use
python3 -m venvor other tools instead ofuv.
-
Agents are isolated Python files that may have different dependencies.
-
Each agent folder must contain a virtual environment:
venvor.venv. -
Run all agents:
genai run_agents
⚠️ If no venv is found, GenAI will fallback to the parent folder or return an error.
If you prefer to register your agent manually:
- Go to
http://localhost:8000/docs. - Log in or sign up.
- Use the
/api/agents/registerendpoint to register your agent.
Example response:
{
"id": "uuid-here",
"name": "my_cool_agent",
"description": "does something great",
"jwt": "your-agent-jwt"
}-
Add the JWT to your agent:
session = GenAISession(jwt_token="your-agent-jwt")
-
Generate the agent file:
genai generate_agent --id uuid-here
This creates an agent file in
agents/folder using the metadata from your API request.
Here’s what a typical agent file looks like:
import asyncio
from typing import Annotated
from genai_session.session import GenAISession
from genai_session.utils.context import GenAIContext
AGENT_JWT = "your-agent-jwt"
session = GenAISession(jwt_token=AGENT_JWT)
@session.bind(name="my_cool_agent", description="does something great")
async def my_cool_agent(
agent_context: GenAIContext,
test_arg: Annotated[str, "Test argument"]
):
return "Hello, World!"
async def main():
print(f"Agent with token '{AGENT_JWT}' started")
await session.process_events()
if __name__ == "__main__":
asyncio.run(main())✅ Once created, remember to set up the agent’s virtual environment before running:
python my_agent.py
# or
genai run_agents