




pip install code2
This is how this article was created in a minute:
code2 prompt new blog
code2 prompt blog render
code2 prompt blog send wholefile
code2 prompt blog send wholefile > ~/src/blog/content/posts/2025-04-06-code2-ai-assisted-code-cli.md
This is the prompt I typed as the first command asked me to:
Write a blog article in markdown about our new code2 software based on the documentation you see here
{{read('/home/jpic/src/cli2/docs/code2.rst')}}
Like it? read on!
Tired of juggling AI tools and scripting hacks? Meet code2 - the CLI that bridges natural language prompts with real-world development tasks through a powerful AI-assisted pipeline.
pip install code2
export OPENROUTER_API_KEY=your_key_here # For default free tier
Create a new prompt:
code2 prompt new hello
(This opens your $EDITOR - enter “create a hello world in python”)
Generate code:
code2 prompt hello send wholefile > hello.py
Iterate with context-awareness:
code2 prompt hello edit # Add: "Update to print sys args {{read('hello.py')}}"
code2 prompt hello send wholefile > hello.py
Watch as code2 intelligently modifies your script while maintaining context!
from code2.model import Model
from code2.prompt import Prompt
async def main():
model = Model.get('architect')
prompt = Prompt('hello')
result = await model.process(prompt, 'wholefile')
# Write result to file...
asyncio.run(main())
code2 cmd pytest -vv tests/test_models.py # AI fixes failing tests automatically!
code2: the AI hacking assistant where YOU are the hero!
After extensive experience with aider-chat and similar tools, we built code2 to address key pain points:
DEBUG=1 code2 prompt hello send # See detailed execution flow
Whether you’re:
code2 adapts to YOUR workflow. Install today and experience the future of development tooling!
pip install code2
Read The Friendly Documentation
Supercharge your terminal. Command smarter, not harder. 💻🚀