Skip to main content

A powerful cli tool to interact with PiecesOS

Project description

Pieces Python CLI Tool

This is a comprehensive command-line interface (CLI) tool designed to interact seamlessly with PiecesOS. It provides a range of functionalities such as asset management, application interaction, and integration with various PiecesOS features.

WebsitePiecesOS DocumentationPieces CLI Documentation

Introducing CLI

Important

Make sure you have PiecesOS installed in order to run the Pieces CLI tool.

Operating System Support

The Pieces Python CLI Tool is compatible with various operating systems, ensuring a wide range of usage and adaptability. While it offers full support across most systems, specific features might have varied performance based on the OS environment.

The CLI Supports

  • Windows 10 or greater
  • Mac
  • Windows

Installing

To get started with the Pieces Python CLI Tool, you need to:

  1. Ensure PiecesOS is installed and running on your system.

  2. Install the Python package:

    pip install pieces-cli
    
    brew install pieces-cli
    
    conda install pieces-cli
    

Getting Started

After installing the CLI tool, you can access its functionalities through the terminal. The tool is initialized with the command pieces followed by various subcommands and options.

Some important terminologies

  • x -> The index
  • current asset -> The asset that you are currently using can be changed by the open command
  • current conversation -> The conversation that you currently using in the ask command

Usage

To refer to the list of all the commands currently supported in the Pieces CLI Agent, visit the documentation.

Contributing

Installation

To run this project locally, follow these steps:

  1. Fork this project via GitHub.

  2. Clone this project:

git clone https://github.com/pieces-app/cli-agent
  1. Create a Virtual Environment
python3 -m venv venv
  1. Activate Your Virtualenv
source venv/bin/activate for Mac & Linux OS

cd venv\Scripts for Windows OS
activate
  1. This project uses poetry for managing dependencies and builds. Install poetry with:
pip install poetry
  1. Then use poetry to install the required dependencies
poetry install
  1. You build with
poetry build
  1. Finally any project dependencies should be added to the pyproject.toml file with
poetry add
  1. Open the Dist folder
cd dist
  1. Install the WHL file
pip install pieces-cli-{VERSION}-py3-none-any.whl

replace the VERSION with the version you downloaded Note: Ensure you get latest from the releases of the cli-agent

  1. To view all the CLI Commands
pieces help

these can be local/github/pypi etc.

Updating

To update the project, run the following command:

pip install pieces-cli --upgrade

Testing

To discover and run all the test cases in the repository, run the following command:

pytest

To check the test coverage, you can use the coverage package. Install coverage with:

pip install coverage

Run the tests with coverage using the following command:

coverage run -m pytest
coverage report

Uninstallation

To uninstall the project, run the following command:

pip uninstall pieces-cli

Don't forget to remove the virtual environment and dist folder

Available Commands

  run               - Starts a looped version of the CLI that only requires you to type the flag

  list              - Lists all the materials in your Pieces Drive (alias: 'drive')
  list apps         - List all registered applications
  list models       - List all registered AI models and change the AI model that you are using the ask command

  modify            - Modify the current material content after you edit it in the editor
  edit              - Edit the current material name or classification you can use -n and -c for name and classification respectively
  delete            - Deletes the current or most recent material.
  create            - Creates a new material based on what you've copied to your clipboard
  execute           - Execute a Pieces bash material
  clear             - to clear the terminal

  config            - View current configuration
  config --editor x - Set the editor to 'x' in the configuration

  ask "ask"       - Asks a single question to the model selected in change model. Default timeout set to 10 seconds
  --materials,-m    - Add material(s) by index. Separate materials with spaces. Run 'drive' to find material indexes
  --file,-f         - Add a certain files or folders to the ask command it can be absolute or relative path

  chats             - List all the chats. The green chat shows the currently using one in the ask command
  chat              - Show the messages of the currently using chat in the ask command
  chat x            - List all the messages in a certain chat and switch to it in the ask command
  -n,--new          - To create a new chat in the ask command
  -d,--delete       - Deletes the current chat
  -r,--rename       - Rename the current chat. If no value given it will let the model rename it for you

  commit            - Commits the changes to github and auto generate the message, you can use -p or --push to push

  search q          - Does a fuzzy search for your query
  --mode ncs        - Does a neural code search for your query
  --mode fts        - Does a full text search for your query

  login             - Login to pieces
  logout            - Logout from pieces

  version           - Gets version of PiecesOS and the version of the cli tool
  help              - Show this help message
  onboarding        - Start the onboarding process
  feedback          - Send feedback to Pieces
  contribute        - Contribute to Pieces CLI
  install           - Install PiecesOS
  open              - Opens PiecesOS

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pieces_cli-1.13.0.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pieces_cli-1.13.0-py3-none-any.whl (71.8 kB view details)

Uploaded Python 3

File details

Details for the file pieces_cli-1.13.0.tar.gz.

File metadata

  • Download URL: pieces_cli-1.13.0.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pieces_cli-1.13.0.tar.gz
Algorithm Hash digest
SHA256 16725afc4e0b41c156bf4b570ec65ee85a763ed9ab5b3cc52cacf072ede5bc79
MD5 2a5d1f9bcd7b52ada4a7c58080d6ff3d
BLAKE2b-256 152a7dd5212c371657f3acb0e58999fb78aa819c67736ce96998a790c88ed91f

See more details on using hashes here.

File details

Details for the file pieces_cli-1.13.0-py3-none-any.whl.

File metadata

  • Download URL: pieces_cli-1.13.0-py3-none-any.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for pieces_cli-1.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fae6d5494bd381b8e835efc720e4a6ee72c959c131787bcd97bfb214707ee8a8
MD5 c9c1686dc5278c6fa4977cac81c7af3b
BLAKE2b-256 395eae1f3b1e0b5f9ba356575a36f4889ae9546f669b9c2d97df3e10ee1f6e6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page