AI-Gents
Gently AI-up your terminal and CLI apps
With (or without) your own agents
A “spec” for agents
AI-gents started as a format/spec/... for me to store my agents
See, everyone and their grand-mother do <<AGENTS>> now, and all these have their own proprietary way of doing it.
I just want to store my agents in a simple way, and then use them with any LLM. Is this too much ?!?!
That is how it started...but first...
What are agents ? like, REALLY ? ?
From all the marketing words salad BS we are force fed, I would define an agent as...
A fancy prompt... (or a set of prompts, that can be chained) tailored to a specific task.
They might come with documents, tools and what not, the point remains, they‘re “just” a fancy prompt.
That does not seem that hard is it ? It is just...
name: AI-gent
version: "0.0.1"
description: "A generic AI agent"
# Model configuration
model:
provider: lmstudio
name: DeepSeek-R1-Distill-Llama-8B
temperature: 0.7
system:
prompt: "You are AI-gent, a helpful AI assistant that provides clear and concise responses."
# Agent settings
settings:
memory_window: 10
max_conversation_turns: 30
tasks:
fresh_context:
description: "get the agent to craft a fresh context"
prompt: |
Create a detailed and effective system prompt based on the provided conversation history as to continue it.
Analyze the task requirements carefully, identifying key objectives, constraints, desired outcomes, and the work done so far. If an existing prompt is provided, preserve its core elements while enhancing clarity and completeness.
# Steps
1. Task Analysis
- Identify main objective and goals
- Note any specific requirements or constraints
- Determine expected output format and structure
2. History Analysis
- Identify the work done so far
- Note any specific successes or failures
- Determine what to include in the new prompt
3. Prompt Structure
- Begin with clear, concise instruction
- Include necessary context and background
- Break down complex tasks into steps
- Specify output format requirements
- Add relevant examples if helpful
4. Quality Checks
- Ensure reasoning precedes conclusions
- Verify clarity and specificity
- Confirm all user-provided content is preserved
- Validate example quality and placeholder usage
# Output Format
The prompt should be formatted in markdown with the following structure:
```
[Main instruction]
[Context and details]
# Steps (if needed)
[Detailed steps]
# Output Format
[Format specifications]
# Examples (if needed)
[Well-structured examples]
# Notes (if needed)
[Additional considerations]
```
# Examples (**FOR DEMONSTRATION PURPOSES ONLY**)
Input: "Create a product description for an e-commerce site"
Output:
Write a compelling product description that effectively communicates key features and benefits.
Consider the target audience, unique selling points, and practical applications of the product.
# Steps
1. Analyze key product features
2. Identify primary benefits
3. Determine target audience needs
4. Craft engaging description
# Output Format
Provide a 2-3 paragraph description (150-200 words) including:
- Attention-grabbing opening
- Feature-benefit connections
- Clear call-to-action
# Examples
Input: [Product: Wireless Earbuds]
Output:
[2-3 compelling paragraphs describing features and benefits]
(Note: Actual descriptions should be fully written out)
# Notes
- Maintain professional tone
- Focus on benefits over features
- Include technical specifications where relevant
A text file to store structured data...
I know, when you put it like that, it sounds **LAME** AF... it is...
So because of that, the fact that I was going to have to test it (the agent file format) and because I do Bash...
I made a “chat app”, yuuup, guessed it, in Bash (heyyyy, what could possibly go wrong ? huuum ?? uuhhh... sh...)
What Could You Use It For ? Cause...
I mean... Bash ? Like... What ? How ? why ? Are things ok in my life ? Did my mom dropped me one too many times as a baby ?
Aaaaalll valid question (good enough thank you, and no she did not, though she‘d probably have said something along the lines of “Why **Dropped** ?!?”, ^^)
Ask or chat with an ai, in your terminal !
I don‘t know about you, but I very often have at least one terminal open
For a quick AI fix, open a terminal, ai ask “something very important“ --stream
, Boom, done.
And if you need more than a single shot you are just an ai chat “I need to talk“
away
In both case, you can choose the --model [ gpt-4 | claude-3.5 |deepseek | ... ]
you wish to have an interaction with and what --provider [ openrouter | openai | anthropic | ollama | ... ]
to use.
If you have peculiar needs, you can always specify them as a --system “please reply only in latin, I am Rex”
Once you are a regular, create an agent !
With time, you refine what you wish, or you want things to go quicker, or, maybe you just cannot get enough,
Whatever the case, it is time for you to ai agent create a-fancy-agent
. It will then live in your $HOME dotfiles, so you can shape it as you desire, make it do whatever you wish, and no one has to know.
Not just One prompt
Sometimes, you can have a nice “base prompt” for your agent, but you might want to make it modular ? Or add functionnalities ?
For that, you can use the “tasks” section in the agent configuration file.
The task prompt is just added to the system prompt when you invoke it. But how do you invoke said task one might ask ?!
Easy... ai agent ask Maurice “#/task the-name-of-your-task;”
, you might want to be careful though, Maurice is a handful !
You can use a #/task ... ;
anywhere in your prompt, it will be removed before sending the message
Being in your terminal offers a perk or two. You know a command line is also called a prompt, right ? What‘s preventing us from using commands in our prompts ?
NICHTSSSSS ! des clous, nada, nothing ! So you can do that anywhere when prompting your ai agent ask Maurice “What file would you recommand for dinner ? #!/tree -I ‘node_modules|cache|test_*‘;”
The previous call will run tree with these arguments and replace the command by its output in the prompt.
What for ... ?
You might say I already have openWebUi or T3.chat and that‘s true, but can these add --ai
to you CLI ?? Hu ? HUUU? !!
I think NOT !
Yeah, having a nice fancy UI is cool, your user are less likely to wear a beard ! Appart from that... oh, yeah maybe they might be a bit less cheap (spoiler alert, I am a cheap bearded individual...)
Aaaannnd, just like UI vs CLI usage for any task, you are way more efficient, especially with completion ! Plus, you can‘t easily script UI interactions, can you ? (ooohh I‘ll race ya and your Playright !)
If you‘d like an example you could give a look at ButT3r, which is my wrapper around create-t3-app, and, it comes with --ai
when creating pages, components or layouts ;).
In the terminal right here, you will also have an example using parseArger, the bash argument and option parsing code generator