Skip to main content

CodePilot CLI

CI CD Code Format Linter PyPI - Version PyPI - Python Version PyPI - Downloads PyPI - License

Introduction

The CodePilot CLI is a sophisticated command-line interface designed to empower developers by streamlining and automating essential coding tasks. Leveraging state-of-the-art AI models, CodePilot offers a comprehensive suite of features aimed at enhancing code quality, generating documentation, writing tests, conducting code reviews, and identifying security vulnerabilities.

Key Features

  • Streamlined Development: Automate repetitive tasks to focus on more strategic work.
  • Code Quality Enhancement: Receive suggestions for code improvements and best practices.
  • Documentation Generation: Quickly generate comprehensive and accurate documentation.
  • Automated Testing: Save time by creating test cases with minimal effort.
  • Security Scanning: Detect potential vulnerabilities in your codebase.
  • Real-time Chat: Engage in real-time discussions with CodePilot for instant assistance.

Demonstration

To gain a deeper understanding of CodePilot CLI's capabilities, we invite you to watch our interactive demonstration video on YouTube.

Interactive Demonstration of CodePilot CLI

Installation

Installing the CodePilot CLI is straightforward. Use the following pip command to install the tool:

pip install code-pilot-cli

Environment Configuration

To authenticate and utilize the CLI effectively, set your Hugging Face token as an environment variable. You can obtain your token from Hugging Face.

Bash

export HF_TOKEN=hf_**********************************

PowerShell

$env:HF_TOKEN = "hf_**********************************"

Usage

Command Structure

code-pilot [OPTIONS] COMMAND [ARGS]...

Available Commands

  • ai: Interact with CodePilot using natural language prompts.
  • chat: Engage in a real-time chat session with CodePilot.
  • completions: Generate code completions from provided snippets.
  • document: Automatically generate comprehensive documentation for code.
  • enhance: Improve code quality by aligning it with best practices.
  • review: Perform detailed code reviews to identify areas for enhancement.
  • scan: Detect security vulnerabilities within your code.
  • test: Automatically generate tests for your code.

Command Details

code-pilot ai

Interact with CodePilot using natural language prompts.

Usage:

code-pilot ai "Build an Expo to-do app using TypeScript and expo-router" -o response.md

Options:

  • -c, --code FILENAME: Include a code file in your prompt.
  • -o, --output FILENAME: Save the response to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot chat

Initiate a chat session with CodePilot to receive real-time assistance.

Usage:

code-pilot chat -e chat_history.json -h chat_history.json

Options:

  • -e, --export FILENAME: Export chat history to a file.
  • -h, --history FILENAME: Import chat history from a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot completions

Generate code completions from code snippets.

Usage:

code-pilot completions "fn say_hello(name: String) -> String:" -l rust -o code-completions.md

Options:

  • -c, --code TEXT: Provide a code snippet.
  • -f, --file FILENAME: Read code from a file.
  • -l, --lang TEXT: Specify the programming language.
  • -o, --output FILENAME: Save the response to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot document

Generate documentation for specified code files.

Usage:

code-pilot document src/lib.rs -o code-docs.md

Options:

  • -o, --output FILENAME: Save the documentation to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot enhance

Improve code quality by applying best practices.

Usage:

code-pilot enhance app/models.py -m meta-llama/Llama-3.2-3B-Instruct -o enhancements.md

Options:

  • -o, --output FILENAME: Save the improvements to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot review

Conduct a thorough code review to identify areas for improvement.

Usage:

code-pilot review code.py -m meta-llama/Llama-3.2-3B-Instruct -o code-review.md

Options:

  • -o, --output FILENAME: Save the review to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot scan

Identify security vulnerabilities present in your code.

Usage:

code-pilot scan src/main.rs -m meta-llama/Llama-3.2-3B-Instruct -o code-scan.md

Options:

  • -o, --output FILENAME: Save the results to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

code-pilot test

Automatically generate tests for your code.

Usage:

code-pilot test App.tsx -m meta-llama/Llama-3.2-3B-Instruct

Options:

  • -o, --output FILENAME: Save the generated tests to a file.
  • -m, --model TEXT: Specify the AI model to use.
  • -t, --max-tokens INTEGER: Set the maximum number of tokens in the response.

Contribution Guide

We welcome contributions to the CodePilot CLI project. To get started, please refer to the Contribution Guide.

Support and Feedback

If you encounter any issues or have suggestions for improvements, please don't hesitate to reach out to us via our GitHub Issues.

License

The CodePilot CLI is distributed under the MIT License.

Metadata

Release files for code-pilot-cli 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-pilot-cli 0.2.1
File Size Uploaded
code_pilot_cli-0.2.1.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-pilot-cli 0.2.1
File Interpreter ABI Platform
code_pilot_cli-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / code_pilot_cli-0.2.1.tar.gz

Download URL code_pilot_cli-0.2.1.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5c5730f7f29b04a06ae2ea9856759e1b3169ae740c72df85c655dee29795b8c6
BLAKE2b-256 checksum
How to use checksums
402b114a070a42f095a9ecc73ff36219e29e9715d2f8fc9a2c9da7b8236dd00a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure

Release files / code_pilot_cli-0.2.1-py3-none-any.whl

Download URL code_pilot_cli-0.2.1-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2f2cb906c63aba076c7b5be6aa2a001afb5d495bcc986160f7c793003fe8ffb9
BLAKE2b-256 checksum
How to use checksums
2b4bafdf2144cafd33b285462fafb6a9c9beca3cb6786f8ed65a17b19c410ec4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.10.12 Linux/6.5.0-1025-azure

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page