habityzer-cli
v1.0.5
Published
CLI tool for managing Habityzer tasks from your terminal
Maintainers
Readme
Habityzer CLI
A powerful command-line interface for managing your Habityzer tasks directly from your terminal. Perfect for developers who want to integrate task management into their workflow.
🚀 Installation
Install the Habityzer CLI locally in your project:
npm install habityzer-cli⚙️ Configuration
Environment Variables
Create a .env file in your project root or set these environment variables:
# Required
HABITYZER_API_TOKEN=your_api_token_here
# Optional (with defaults)
HABITYZER_PROJECT_ID=2 # Default project ID
HABITYZER_API_BASE_URL=https://s.habityzer.com/api # API base URLGetting Your API Token
- Log into your Habityzer account
- Navigate to API settings
- Generate a new API token
- Copy the token to your
.envfile
📖 Usage
Basic Commands
After installation, you can use the CLI with npx:
# List all active tasks
npx habityzer list
# List all tasks (including completed)
npx habityzer list --all
# Create a new task
npx habityzer create "Fix bug in authentication"
# Create a task with description
npx habityzer create "Implement feature X" --description "Add new functionality for user management"
# Update task status
npx habityzer update 123 --status 3 # Move to "In Progress"
# Show task details
npx habityzer show 123
# Delete a task
npx habityzer delete 123
# List all projects
npx habityzer projects
# List task statuses
npx habityzer statusesNPM Scripts Integration
Add Habityzer commands to your package.json scripts:
{
"scripts": {
"tasks": "habityzer list",
"tasks:all": "habityzer list --all",
"task:create": "habityzer create",
"task:show": "habityzer show"
}
}Then use them with:
npm run tasks
npm run task:create "New task title"🎯 Cursor Integration
Method 1: AI Assistant Integration (Recommended)
Copy the .cursorrules file from this repository to your project root. This configures Cursor's AI to automatically use the Habityzer CLI when you ask about tasks.
Quick setup:
- Copy
.cursorrulesto your project root - Ask the AI: "What are my current tasks?"
- The AI will automatically run
npx habityzer listand show results
Method 2: Terminal Integration
- Open Cursor terminal (
Ctrl/Cmd + J) - Run Habityzer commands directly:
npx habityzer list
Method 3: Custom Commands
Add Cursor custom commands by creating .cursor/commands.json:
{
"commands": [
{
"name": "List Habityzer Tasks",
"command": "npx habityzer list",
"type": "terminal"
},
{
"name": "Create Habityzer Task",
"command": "npx habityzer create \"${input:taskTitle}\"",
"type": "terminal"
}
]
}Method 4: Workspace Tasks
Add to .vscode/tasks.json (also works in Cursor):
{
"version": "2.0.0",
"tasks": [
{
"label": "List Tasks",
"type": "shell",
"command": "npx",
"args": ["habityzer", "list"],
"group": "build"
},
{
"label": "Create Task",
"type": "shell",
"command": "npx",
"args": ["habityzer", "create", "${input:taskTitle}"],
"group": "build"
}
],
"inputs": [
{
"id": "taskTitle",
"description": "Task title",
"default": "New task",
"type": "promptString"
}
]
}📋 Command Reference
list [options]
List tasks with optional filters.
Options:
--all- Include completed tasks--project <id>- Filter by project ID--status <id>- Filter by status ID
Examples:
npx habityzer list # Active tasks only
npx habityzer list --all # All tasks
npx habityzer list --project 1 # Tasks from project 1
npx habityzer list --status 2 # Tasks with status "Todo"create <title> [options]
Create a new task.
Arguments:
<title>- Task title (required)
Options:
--description <text>- Task description--status <id>- Initial status (default: 2 = Todo)--priority <level>- Priority level 1-5 (default: 2)
Examples:
npx habityzer create "Fix login bug"
npx habityzer create "New feature" --description "Implement user dashboard" --priority 3show <taskId>
Display detailed information about a specific task.
Examples:
npx habityzer show 123update <taskId> [options]
Update an existing task.
Arguments:
<taskId>- Task ID to update
Options:
--title <text>- New title--description <text>- New description--status <id>- New status ID--priority <level>- New priority level
Examples:
npx habityzer update 123 --status 3 # Move to "In Progress"
npx habityzer update 123 --title "Updated title"
npx habityzer update 123 --priority 4 --status 4 # High priority, completeddelete <taskId>
Delete a task permanently.
Examples:
npx habityzer delete 123projects
List all available projects.
statuses
List all available task statuses.
🔧 Development Workflow
Quick Task Creation
# Start working on a feature
npx habityzer create "Implement user authentication" --status 3
# Check current tasks
npx habityzer list
# Mark as complete when done
npx habityzer update 123 --status 4Integration with Git Hooks
Add to .husky/pre-commit:
#!/bin/sh
npx habityzer list --status 3 # Show in-progress tasks before commit🛠️ Troubleshooting
Common Issues
"API token required" error:
- Ensure
HABITYZER_API_TOKENis set in your.envfile - Verify the token is valid and hasn't expired
"Failed to fetch tasks" error:
- Check your internet connection
- Verify
HABITYZER_API_BASE_URLis correct - Ensure your API token has proper permissions
Command not found:
- Run
npm install habityzer-clito ensure it's installed - Use
npx habityzerinstead of justhabityzer
📝 License
MIT License - see LICENSE file for details.
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
🔗 Links
📊 Task Status Reference
Common status IDs:
1- Idea2- Todo3- In Progress4- Done
Use npx habityzer statuses to see all available statuses for your workspace.
