New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fir-cli

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fir-cli

A powerful command line tool for daily development, featuring Git operations, code statistics, time management, and AI assistance

latest
Source
npmnpm
Version
1.0.20
Version published
Maintainers
0
Created
Source

fir-cli

A modern CLI tool that enhances your development workflow with AI-powered features.

English | 简体中文

Features

  • 🌐 Multi-language Support: Switch between English and Chinese interfaces
  • 🤖 AI Integration: Built-in AI assistant for various tasks
  • Time Display: Show current time in Beijing and UTC
  • 🌍 IP Information: Display both local and public IP addresses
  • 🔄 Git Operations: Streamlined git workflow with AI-powered commit messages
  • 🌐 Translation: Quick English-Chinese text translation
  • ⚙️ Configuration: Easy-to-use settings management
  • 🎯 Smart Aliases: Intuitive command aliases for faster operation

Installation

npm i fir-cli -g

Configuration (Optional)

The CLI works out of the box for basic Git operations. For AI-powered features, you'll need to configure OpenAI API access.

Create a .firrc file in your home directory:

{
  "openai": {
    "apiKey": "your-api-key",
    "apiBaseUrl": "your-api-base-url",  // Optional
    "apiModel": "your-api-model"        // Optional
  }
}

Or use environment variables:

  • OPENAI_API_KEY: Your OpenAI API key (required for AI features)
  • OPENAI_API_BASE_URL: Custom API base URL (optional)
  • OPENAI_API_MODEL: Custom API model (optional)

Quick Start

  • Initialize Git repository:

    git init
    
  • Make some changes to your code

  • Commit with AI-generated message:

    f commit
    
  • Push to remote:

    f push
    

Command Reference

CommandAliasDescriptionExample
Git Commands
f commitf c, f co, f comCommit changes with AI messagef commit
f commit -vf c -v, f co -v, f com -vCommit with verbose modef c -v
f pushf p, f puPush changes to remotef push
f push -vf p -v, f pu -vPush with verbose modef p -v
f open-Open repository in browserf open
f cleanf c, f clClean working directoryf clean
f gitf g, f giGit operationsf git open
Editor Commands
f codef c, f coOpen in VS Codef code
f webstorm-Open in WebStormf webstorm
Browser Commands
f chromef c, f chOpen Chromef chrome
f chrome <url>f c <url>, f ch <url>Open Chrome with URLf chrome https://github.com
Network Commands
f ipf i, f ipShow local IP addressesf ip
f pingf p, f piPing domain(s)f ping github.com
NPM Commands
f nrm-Run NRM packagef nrm ls
f ncu-Check package updatesf ncu
f installf i, f inRun or install and run a global npm packagef install nrm
Time Commands
f timef t, f tiShow current timef time
f time --watchf t --watch, f ti -wShow auto-updating timef time --watch
AI Commands
f translatef t, f trTranslate text between languagesf translate "Hello"
f debugf d, f deDebug code with AI assistancef debug
f aif a, f aiChat with AI assistantf ai "How to use git?"
Other Commands
f configf c, f coConfigure CLI settingsf config set openai.apiKey "your-key"
f help-Show help informationf help commit
f statisticsf s, f st, f statsShow code statisticsf statistics
f statistics -d-Show last 24h changesf statistics -d
f statistics -w-Show last week changesf statistics -w
f statistics -m-Show last month changesf statistics -m
f statistics -y-Show last year changesf statistics -y

Features

Git Commands

Commit Changes (f commit or f c)

Commit changes with AI-generated commit messages.

Features:

  • Auto-detects and stages unstaged changes
  • Generates meaningful commit messages using AI
  • Supports manual commit messages
  • Shows detailed status information

Example:

# Basic commit with AI message
f commit

# Commit with verbose mode
f c -v

# Example AI-generated message:
feat(auth): add OAuth2 authentication with Google provider
- Implement OAuth2 flow for Google authentication
- Add user profile synchronization
- Update configuration for OAuth credentials

Push Changes (f push or f p)

Push changes to remote repository.

Features:

  • Shows current changes and unpushed commits
  • Auto-stages and commits changes
  • Creates remote branch if needed
  • Handles upstream branch setup

Example:

# Push with AI commit message
f push

# Push with verbose mode
f p -v

# Status output example:
Git Status:
----------------------------------------
Branch: feature/auth
Last Commit: a1b2c3d - feat: add login page

Changed Files:
  Modified: src/auth/login.ts
  Added: src/components/LoginForm.tsx
  
Unpushed commits:
a1b2c3d feat: add login page
b2c3d4e fix: handle auth errors
----------------------------------------

Open Repository (f open)

Open repository in browser.

Features:

  • Supports both HTTPS and SSH remote URLs
  • Opens in default browser
  • Handles GitHub, GitLab, and Bitbucket URLs

Example:

# Open current repository
f open

# Output example:
✓ Opening https://github.com/username/repo in browser

Clean Working Directory (f clean)

Clean working directory and remove untracked files.

Features:

  • Shows detailed status before cleaning
  • Resets staged changes
  • Removes untracked files
  • Interactive confirmation

Example:

# Clean working directory
f clean

# Output example:
Found changes:

Modified files:
  src/components/Button.tsx
  src/styles/main.css

Untracked files:
  .env.local
  temp/

AI Commands

Translate Code (f translate or f t)

Translate code between programming languages.

Features:

  • Supports multiple programming languages
  • Preserves code structure and logic
  • Adds helpful comments
  • Handles language-specific idioms

Example:

# Translate current file
f translate python typescript

# Example output:
# Python input:
def calculate_total(items):
    return sum(item.price for item in items)

# TypeScript output:
function calculateTotal(items: Item[]): number {
    return items.reduce((sum, item) => sum + item.price, 0);
}

Debug Code (f debug or f d)

Debug code with AI assistance.

Features:

  • Analyzes code and error messages
  • Provides detailed explanations
  • Suggests fixes
  • Shows examples

Example:

# Debug last error
f debug

# Example output:
Error Analysis:
- TypeError: Cannot read property 'data' of undefined
- Location: src/api/users.ts:45
- Root cause: API response is undefined before access

Solution:
1. Add null check before accessing data:
   ```typescript
   const response = await api.get('/users');
   const data = response?.data ?? [];

Prevention:

  • Always handle undefined/null cases
  • Use optional chaining and nullish coalescing
  • Add type checking

## New in v1.0.13

### Multi-language Support
- 🌐 Full interface localization in English and Chinese
- 🔄 Easy language switching through config menu
- 📝 Localized command outputs and messages
- 🎯 Consistent formatting across languages
- 💡 AI responses in your preferred language

### Enhanced Output Formatting
- ⚡ Aligned and structured command outputs
- 🎨 Better visual organization of information
- 📊 Consistent spacing and indentation
- 🔍 Clear separation of different data types
- ✨ Improved readability for all commands

### Other Improvements
- 🛠️ Enhanced error handling
- ⚡ Optimized performance
- 🔄 Smoother language switching
- 📱 Better terminal UI experience

## Development

1. Clone the repository
2. Install dependencies:
   ```bash
   npm install
  • Build the project:
    npm run build
    
  • Link for local development:
    npm link
    

License

MIT

Keywords

cli

FAQs

Package last updated on 12 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts