session command manages conversation sessions, allowing you to save, resume, and organize multi-turn interactions.
Quick Start
Copy
# Start a new session
praisonai session start my-project
# List all sessions
praisonai session list
Commands
Start a Session
Copy
praisonai session start my-project
Copy
🆕 Starting new session: my-project
Session created successfully!
┌─────────────────────┬────────────────────────────┐
│ Property │ Value │
├─────────────────────┼────────────────────────────┤
│ Session ID │ my-project │
│ Created │ 2024-12-16 15:30:00 │
│ Status │ active │
│ Messages │ 0 │
└─────────────────────┴────────────────────────────┘
You can now run commands with this session context.
Use: praisonai "your prompt" --session my-project
List Sessions
Copy
praisonai session list
Copy
📋 Available Sessions:
┌────┬─────────────────┬─────────────────────┬──────────┬──────────┐
│ # │ Session ID │ Last Active │ Messages │ Status │
├────┼─────────────────┼─────────────────────┼──────────┼──────────┤
│ 1 │ my-project │ 2024-12-16 15:45 │ 12 │ active │
│ 2 │ research-task │ 2024-12-16 14:20 │ 8 │ paused │
│ 3 │ code-review │ 2024-12-15 10:30 │ 25 │ paused │
│ 4 │ documentation │ 2024-12-14 09:15 │ 5 │ archived │
└────┴─────────────────┴─────────────────────┴──────────┴──────────┘
Total: 4 sessions
Resume a Session
Copy
praisonai session resume my-project
Copy
▶️ Resuming session: my-project
Session restored successfully!
┌─────────────────────┬────────────────────────────┐
│ Property │ Value │
├─────────────────────┼────────────────────────────┤
│ Session ID │ my-project │
│ Messages │ 12 │
│ Last Message │ "Can you explain..." │
│ Context Size │ 2,456 tokens │
└─────────────────────┴────────────────────────────┘
Session context loaded. Continue your conversation:
Show Session Details
Copy
praisonai session show my-project
Copy
📊 Session Details: my-project
┌─────────────────────┬────────────────────────────┐
│ Property │ Value │
├─────────────────────┼────────────────────────────┤
│ Session ID │ my-project │
│ Created │ 2024-12-16 15:30:00 │
│ Last Active │ 2024-12-16 15:45:00 │
│ Status │ active │
│ Total Messages │ 12 │
│ User Messages │ 6 │
│ Agent Messages │ 6 │
│ Total Tokens │ 4,523 │
│ Storage Size │ 45 KB │
└─────────────────────┴────────────────────────────┘
Recent Messages:
────────────────────────────────────────────────────
[User] Can you explain the authentication flow?
[Agent] Based on the code, the authentication...
────────────────────────────────────────────────────
[User] How do I add OAuth support?
[Agent] To add OAuth support, you would need to...
────────────────────────────────────────────────────
Delete a Session
Copy
praisonai session delete my-project
Copy
⚠️ Delete session 'my-project'?
This will permanently remove all conversation history.
Are you sure? (y/N): y
🗑️ Session 'my-project' deleted successfully.
Help
Copy
praisonai session help
Copy
Session Commands:
praisonai session start <name> - Start a new session
praisonai session list - List all sessions
praisonai session resume <name> - Resume a session
praisonai session show <name> - Show session details
praisonai session delete <name> - Delete a session
praisonai session help - Show this help
Using Sessions with Prompts:
praisonai "prompt" --session <name> - Run with session context
Using Sessions with Prompts
Continue a Conversation
Copy
# First message
praisonai "What is Python?" --session learning
# Follow-up (context preserved)
praisonai "How do I install it?" --session learning
# Another follow-up
praisonai "Show me a hello world example" --session learning
Copy
📂 Session: learning (3 messages)
╭────────────────────────────────── Response ──────────────────────────────────╮
│ Based on our conversation about Python, here's a hello world example: │
│ │
│ ```python │
│ print("Hello, World!") │
│ ``` │
│ │
│ After installing Python as we discussed, save this to a file called │
│ `hello.py` and run it with `python hello.py` │
╰──────────────────────────────────────────────────────────────────────────────╯
Session with Other Features
Copy
# Session with memory
praisonai "Remember my preferences" --session project --memory
# Session with knowledge
praisonai "Search the docs" --session project --knowledge
# Session with planning
praisonai "Plan the implementation" --session project --planning
Use Cases
Project-Based Conversations
Copy
# Start project session
praisonai session start website-redesign
# Multiple conversations over time
praisonai "What's the current design?" --session website-redesign
praisonai "Suggest improvements" --session website-redesign
praisonai "Create implementation plan" --session website-redesign
Learning Sessions
Copy
# Create learning session
praisonai session start learn-rust
# Progressive learning
praisonai "Explain ownership in Rust" --session learn-rust
praisonai "Show me an example" --session learn-rust
praisonai "What about borrowing?" --session learn-rust
Code Review Sessions
Copy
# Start review session
praisonai session start pr-review-123
# Review conversation
praisonai "Review this PR" --session pr-review-123 --fast-context ./src
praisonai "What about security concerns?" --session pr-review-123
praisonai "Summarize the review" --session pr-review-123
Session Storage
Sessions are stored locally in.praison/sessions/:
Copy
.praison/
└── sessions/
├── my-project.json
├── research-task.json
└── code-review.json
Best Practices
Use descriptive session names that reflect the project or task for easy identification.
Long sessions accumulate tokens. Consider starting fresh sessions for unrelated topics.
Naming
Use descriptive names like
project-auth-featureOrganization
Create separate sessions for different projects
Cleanup
Delete old sessions to free up storage
Context
Start new sessions when changing topics significantly

