-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* style: Fix formatting to singlequotes in python * chore(deps): Add platformdirs v4.2.2 * chore(deps): Add typing-extensions v4.12.2 * Setup Nexis CLI file structure * Add configuration files for Nexis CLI * chore: Bump Nexis 0.1.1 -> 0.2.0 --- Signed-off-by: AlexNg <[email protected]>
- Loading branch information
Showing
42 changed files
with
1,419 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ indent_style = tab | |
[*.py] | ||
charset = utf-8 | ||
indent_size = 4 | ||
quote_type = double |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Nexis CLI | ||
|
||
Nexis is a powerful command-line (CLI) tool for | ||
interacting with the Nexis (or your) API. | ||
|
||
## Installation | ||
|
||
You can install the CLI from the [Python Package Index](https://pypi.org/project/nexis/). | ||
Simply install it with your preferred package manager: | ||
|
||
```sh | ||
pip install nexis | ||
poetry add nexis | ||
pipx install nexis | ||
``` | ||
|
||
## Getting Started | ||
|
||
After installing Nexis, you can run it from your terminal: | ||
|
||
```sh | ||
nexis [command] [options] [arguments] | ||
``` | ||
|
||
To see a list of available commands, run: | ||
|
||
```sh | ||
nexis --help | ||
``` | ||
|
||
## Usage | ||
|
||
Running `Nexis` without any arguments will show you the help message. | ||
|
||
```text | ||
Usage: | ||
command [options] [arguments] | ||
Options: | ||
-h, --help Display help for the given command. | ||
-q, --quiet Do not output any message. | ||
-V, --version Display this application version. | ||
--ansi Force ANSI output. | ||
--no-ansi Disable ANSI output. | ||
-n, --no-interaction Do not ask any interactive question. | ||
-D, --dev Use development options defined in nexis.toml. | ||
-C, --config=CONFIG Use the specified configuration file. | ||
-v|vv|vvv, --verbose Increase the verbosity of messages: | ||
1 for normal output | ||
2 for more verbose output | ||
3 for debug. | ||
Available commands: | ||
help Display help for a command. | ||
list List commands. | ||
... | ||
``` | ||
|
||
## Commands | ||
|
||
Nexis comes with a variety of commands. | ||
For detailed information on each command, refer to the | ||
[Commands Documentation](./commands/README.md) | ||
|
||
## Configuration | ||
|
||
Nexis can be configured using the `nexis.toml` TOML file. | ||
The configuration file load order is as follows: | ||
|
||
1. `~/.config/nexis/nexis.toml` | ||
2. `$CWD/nexis.toml` | ||
3. Path from `-C/--config` option (if provided) | ||
|
||
For detailed information on the configuration file, | ||
refer to the [Configuration Documentation](./config.md) | ||
|
||
## Closing | ||
|
||
If you encounter any problems or have questions, please | ||
feel free to [open an issue](https://github.com/caffeine-addictt/nexis/issues/new). | ||
If you enjoy using Nexis, please consider [sponsoring us](https://github.com/sponsors/caffeine-addictt) | ||
or giving us a [✨ star](https://github.com/caffeine-addictt/nexis/stargazers)! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Commands | ||
|
||
This section describes the commands that `Nexis` supports. | ||
|
||
## Global flags and options | ||
|
||
Global flags and options can be used in any command. | ||
Simply pass them to the command. | ||
|
||
```sh | ||
# For a shorthand flag | ||
nexis -h | ||
|
||
# For a longhand flag | ||
nexis --help | ||
|
||
# For a shorthand option | ||
nexis -C nexis.toml | ||
|
||
# For a longhand option | ||
nexis --config nexis.toml | ||
``` | ||
|
||
The difference between a flag and an option is that a flag takes no argument, | ||
while an option takes an argument. | ||
|
||
### Flags | ||
|
||
- `-h, --help` - Show help for the command. | ||
- `-q, --quiet` - Do not output anything. | ||
- `-V, --version` - Show the installed version of the `Nexis. | ||
- `--ansi` - Force ANSI output. | ||
- `-n, --no-interaction` - Do not ask any interactive question. | ||
- `-D, --dev` - When enabled, the command will be executed with development configuration. | ||
- `-v, -vv, -vvv, --verbose` - Set the verbosity of the command. | ||
1 `v` for normal output, | ||
2 `v`'s for more verbose output and | ||
3 `v`'s for debug. | ||
|
||
### Options | ||
|
||
- `-C, --config <file_path>` - Path to the configuration file to be loaded. | ||
|
||
## List of commands | ||
|
||
Click on the command names to view detailed documentation for each command. | ||
|
||
- [docs](./docs.md) | ||
- [list](./list.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# docs | ||
|
||
Go to the documentation! | ||
|
||
## Usage | ||
|
||
Running this will open the docs in a new browser tab. | ||
|
||
```sh | ||
nexis docs [options] | ||
``` | ||
|
||
## Options | ||
|
||
- `-B, --browserless` - Providing this flag will not open the docs in your browser. | ||
|
||
## Arguments | ||
|
||
This command has no arguments. | ||
|
||
## Examples | ||
|
||
```sh | ||
# Open the docs in a new browser tab | ||
nexis docs | ||
|
||
# Only print the URL | ||
nexis docs -B | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# list | ||
|
||
List all the available commands. | ||
|
||
## Usage | ||
|
||
```sh | ||
nexis list [options] [--] [<namespace>] | ||
``` | ||
|
||
## Options | ||
|
||
This command has no options. | ||
|
||
## Arguments | ||
|
||
- `namespace` (optional) The namespace to list. | ||
|
||
## Examples | ||
|
||
```sh | ||
# Lists all the available commands | ||
nexis list | ||
|
||
# Lists all the available commands in `config` | ||
nexis list config | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Configutation | ||
|
||
This section describes how to configure `Nexis`. | ||
|
||
## Configuration File | ||
|
||
`Nexis` uses TOML files for configuration. | ||
The configuration file load order is: | ||
|
||
1. `~/.config/nexis/nexis.toml` | ||
2. `$CWD/nexis.toml` | ||
3. Path from `-C/--config` option (if provided) | ||
|
||
### `nexis.toml` | ||
|
||
This is the default configuration used by `Nexis`. | ||
|
||
```toml | ||
mode = "dev" | ||
|
||
[network] | ||
api_url = "http://localhost:3000" | ||
|
||
[development.network] | ||
api_url = "http://localhost:3000" | ||
``` | ||
|
||
## Customizing Configuration | ||
|
||
The following options are available for `Nexis`: | ||
|
||
- `mode`: `dev` or `prod` (default: `dev`) | ||
- `version`: The version of Nexis to use (defaults to the local `Nexis` version) | ||
- `network.api_url`: The base URL of the Nexis API (default: `http://localhost:3000`) | ||
- `development.network.api_url`: The base URL of the Nexis API in development mode | ||
(default: `http://localhost:3000`) |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "nexis" | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
description = "NYP InfoSec Auth CLI" | ||
authors = ["Alex <[email protected]>"] | ||
license = "GPL-3.0" | ||
|
@@ -34,12 +34,14 @@ Source = "https://github.com/caffeine-addictt/nexis" | |
"Bug Tracker" = "https://github.com/caffeine-addictt/nexis/issues" | ||
|
||
[tool.poetry.scripts] | ||
nexis = "nexis.entrypoint:main" | ||
nexis = "nexis.console.entrypoint:main" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
cleo = "^2.1.0" | ||
importlib-metadata = { version = ">=4.4", python = "<3.10" } | ||
typing-extensions = "^4.12.2" | ||
platformdirs = "^4.2.2" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^8.3.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import sys | ||
|
||
|
||
if __name__ == '__main__': | ||
if __name__ == "__main__": | ||
from nexis.entrypoint import main | ||
|
||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
from nexis.version import __version__ | ||
|
||
__all__ = ['__version__'] | ||
__all__ = ["__version__"] |
Empty file.
Oops, something went wrong.