# zero-cli
A command line tool for Zero Secrets Manager.
## Overview
This CLI tool allows users to manage secrets and projects within the Zero Secrets Manager. It provides functionalities for authentication, project management, secret management, team handling, and more.
## Installation
To install the `zero-cli` from Crates.io, use the following command:
```bash
cargo install zero-cli
```
This command will download the crate, compile all the binary targets it contains (in "release" mode), and copy them into the ~/.cargo/bin/ directory. Ensure that your shell knows to look there for binaries!
## Usage
The CLI offers various subcommands:
- auth: Authentication and authorization functionalities.
- projects: Manage projects, including creation, deletion, editing, listing, sharing, usage overview, and viewing details.
- secrets: Handle secrets, allowing users to create, delete, edit, list, share, and view details.
- teams: Operations related to teams, such as creation, deletion, editing, leaving, listing, managing users, and viewing details.
- help: Display help information about the CLI or a specific subcommand.
## 🛠Development guide
Run
```bash
cargo run
```
or if you want to test the command run from src folder
```bash
cargo run -- auth login
```
Codegen
```bash
cargo install graphql_client_cli
```
```bash
graphql-client generate <query_path> --schema-path <schema_path>
````
as example
```
graphql-client generate src/auth/graphql/me.graphql --schema-path schema.graphql
```
Download schema
```bash
gq http://localhost:8080/v1/graphql -H 'X-Hasura-Admin-Secret:111' --introspect > schema.graphql
```
## Dependencies used:
- chrono - A comprehensive date and time library for Rust. It provides a rich set of functionalities to work with dates, times, time zones, durations, and formatting.
- clap - A crate for handling command-line arguments. It allows you to create convenient command-line interfaces for your applications and parse the provided arguments.
- dialoguer - A Rust library for building interactive command-line applications. It provides a set of utilities for getting input from the user and displaying messages.
- dotenv - It loads environment variables from a .env file, if available.
- graphql_client - A Rust library for making GraphQL queries. It helps you interact with GraphQL APIs and handle responses in your application.
- keyring - A library for managing user-level secret storage. It provides a secure way to store and retrieve sensitive information, such as passwords and API keys.
- open - A cross-platform Rust library for opening files, directories, and URLs with the default system application. It simplifies the process of launching external resources.
- regexp - A Rust library focused on regular expressions. It provides functionality for pattern matching, searching, and replacing within strings, allowing developers to work with complex text patterns with ease.
- reqwest - An HTTP client library for Rust. It allows your application to make HTTP requests to remote servers and handle responses, including JSON parsing.
- serde - A Rust library for serializing and deserializing data structures. It's often used for working with JSON, YAML, and other data formats.
- serde_json - A JSON serialization and deserialization library for Rust. It provides support for working with JSON data in Rust applications.
- strum - A Rust crate that offers additional functionalities for enums. With strum, developers can derive custom string representations, iterate over variants, and utilize various helpers for enums, enhancing the standard enum capabilities in Rust.
- termimad - A Rust library for rendering markdown in the terminal. It enables you to display formatted text and documents in a terminal environment.
- tokio - An asynchronous runtime for Rust. It provides a framework for writing asynchronous and concurrent code, making it easier to work with non-blocking I/O and asynchronous tasks.
- uuid - A crate for generating and working with Universally Unique Identifiers (UUIDs) in Rust. It's commonly used for creating unique identifiers in distributed systems and databases.