chat Command
Interactive chat with MyDeskBot.
Usage
bash
mydeskbot chat [options]Options
| Option | Alias | Description | Default |
|---|---|---|---|
--model | -m | AI model to use | Configured model |
--temperature | -t | Temperature (0.0-2.0) | 1.0 |
--max-tokens | -n | Max response tokens | 4096 |
--system | -s | System prompt | - |
--history | -H | Load conversation history | - |
--save | Save conversation to file | - | |
--no-color | Disable colored output | false | |
--help | -h | Show help | - |
Interactive Commands
Once in chat mode, use these commands:
| Command | Description |
|---|---|
/help | Show help |
/clear | Clear conversation history |
/history | Show conversation history |
/model <name> | Change model |
/temperature <value> | Set temperature |
/save <file> | Save conversation |
/load <file> | Load conversation |
/exit or /quit or Ctrl+D | Exit chat |
/code <file> | Include code file in context |
Examples
Start Chat
bash
mydeskbot chatWith Custom Model
bash
mydeskbot chat --model gpt-4With System Prompt
bash
mydeskbot chat --system "You are a Python expert"Save Conversation
bash
mydeskbot chat --save conversation.jsonLoad Conversation History
bash
mydeskbot chat --history conversation.jsonSession Example
bash
$ mydeskbot chat
> Hello! I'm MyDeskBot CLI. How can I help you today?
You: How do I create a REST API with Node.js and Express?
MyDeskBot: Here's how to create a REST API with Node.js and Express:
1. Initialize project:
npm init -y
npm install express
2. Create server.js:
const express = require('express');
const app = express();
app.use(express.json());
app.get('/api/users', (req, res) => {
res.json({ users: [] });
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
3. Run server:
node server.js
Would you like me to explain any part in more detail?
You: Add authentication
MyDeskBot: Here's how to add JWT authentication:
[...]
You: /save my-chat.json
Conversation saved to my-chat.json
You: /exit
Goodbye!Use Cases
1. Code Assistance
You: Help me debug this error
[Show error]
MyDeskBot: The error indicates...2. Learning
You: Explain how promises work in JavaScript
MyDeskBot: Promises in JavaScript are...3. Brainstorming
You: Give me ideas for a mobile app
MyDeskBot: Here are some mobile app ideas...4. Code Review
You: Review this code
[Show code]
MyDeskBot: Here's my review...5. Problem Solving
You: I have a slow API, how can I optimize it?
MyDeskBot: Here are optimization strategies...Context Management
Include Code Files
You: /code src/utils/helper.js
File included: src/utils/helper.js
You: Add error handling to this function
MyDeskBot: Here's the function with error handling...Clear Context
You: /clear
Conversation history cleared.View History
You: /history
Conversation History:
====================
1. You: How do I create a REST API?
Bot: [Response]
2. You: Add authentication
Bot: [Response]Configuration in Chat
Change Model
You: /model gpt-4
Model changed to gpt-4Set Temperature
You: /temperature 0.5
Temperature set to 0.5Saving and Loading
Save Conversation
You: /save my-conversation.json
Saved to my-conversation.jsonLoad Conversation
bash
# From command line
mydeskbot chat --history my-conversation.json
# Or in chat
You: /load my-conversation.json
Loaded my-conversation.jsonTips
1. Be Clear and Specific
Good: "How do I implement pagination in a PostgreSQL query?"
Less clear: "How to paginate?"2. Provide Context
You: I'm building a React app with TypeScript and need to handle forms
MyDeskBot: Here's how to handle forms in React with TypeScript...3. Follow Up
You: Create a REST API
[Response]
You: Add authentication
[Response]
You: Add rate limiting
[Response]4. Save Useful Conversations
You: /save api-tutorial.json
Saved to api-tutorial.jsonAdvanced Features
Multi-turn Conversations
You: What is React?
MyDeskBot: React is...
You: How is it different from Vue?
MyDeskBot: React differs from Vue in...
You: Which one should I choose?
MyDeskBot: The choice depends on...Code Exploration
You: /code src/
Multiple files in src/:
- src/App.js
- src/utils/helper.js
- src/components/Header.js
Which file would you like to include?System Prompts
bash
mydeskbot chat --system "You are a senior Python developer. Always provide production-ready code with error handling and documentation."Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+C | Cancel current request |
Ctrl+D | Exit chat |
Ctrl+L | Clear screen |
Up Arrow | Previous message |
Down Arrow | Next message |
Tab | Autocomplete commands |
Troubleshooting
Chat Not Responding
Problem: No response from AI
Solutions:
- Check API key is configured
- Check internet connection
- Try a different model
- Check API quota
History Not Saving
Problem: Conversation history lost
Solutions:
- Use
/savecommand before exiting - Check file permissions
- Use
--saveoption when starting
Code Not Found
Problem: /code command can't find file
Solutions:
- Use absolute or relative path
- Check file exists
- Use correct file extension