pluggable-cli-deno/readme.md

145 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

2022-02-12 03:08:54 -06:00
# CLI Proof-of-Concept
None of this crap is really tested. Have fun!
2022-02-12 13:18:25 -06:00
[🖥️ Upstream][upstream] • [🐙 GitHub Mirror][github]
## Installation
2022-02-12 03:21:41 -06:00
Run the below scripts to install `poc-cli` for your platform:
### Linux x86_64
```sh
sudo curl -o /usr/bin/poc-cli \
https://files.lyte.dev/poc-cli/poc-cli.linux.x86_64
sudo chmod 755 /usr/bin/poc-cli
```
### macOS Intel
```sh
sudo curl -o /usr/bin/poc-cli \
https://files.lyte.dev/poc-cli/poc-cli.darwin.x86_64
sudo chmod 755 /usr/bin/poc-cli
```
2022-02-12 03:21:41 -06:00
### macOS Apple Silicon (M1)
```sh
sudo curl -o /usr/bin/poc-cli \
https://files.lyte.dev/poc-cli/poc-cli.darwin.aarch64
sudo chmod 755 /usr/bin/poc-cli
```
### Just let me download files through my browser like a normal human being
Ok, fine geez.
- **File Archive**: https://files.lyte.dev/poc-cli/
### Why are these binaries so freakin' big?
It's got the whole Deno runtime packed in there.
Also, something something your mom. <3
2022-02-12 03:08:54 -06:00
## Known Issues
- The plugin directory being present doesn't _really_ mean it's "installed" ;P
## Compile It Yourself
2022-02-12 03:08:54 -06:00
```sh
deno compile -A -o poc-cli src/core.ts
```
You can cross-compile, too. See `deno compile --help` for `--target`.
2022-02-17 12:56:55 -06:00
```sh
deno compile -A -o poc-cli.linux.x86_64 --target x86_64-unknown-linux-gnu src/core.ts
deno compile -A -o poc-cli.darwin.x86_64 --target x86_64-apple-darwin src/core.ts
deno compile -A -o poc-cli.darwin.aarch64 --target aarch64-apple-darwin src/core.ts
```
2022-02-17 12:56:18 -06:00
### Run Without Compiling
2022-02-17 12:56:55 -06:00
```sh
2022-02-17 12:56:18 -06:00
deno run -A src/core.ts
```
2022-02-12 14:18:38 -06:00
### Deploy Artifacts
2022-02-17 12:56:55 -06:00
```sh
2022-02-12 14:18:38 -06:00
rcp ./poc-cli.* faceless:~/../public-static-files/poc-cli/
```
### Install
2022-02-12 03:08:54 -06:00
I dunno, but probably something like this:
```sh
sudo mv poc-cli /usr/bin/poc-cli
2022-02-12 03:08:54 -06:00
sudo chown root:root /usr/bin/poc-cli
sudo chmod 755 /usr/bin/poc-cli
```
## Usage
2022-02-12 13:18:25 -06:00
It's self-documenting... sort of!
2022-02-12 03:08:54 -06:00
2022-02-17 12:56:55 -06:00
```sh
2022-02-12 03:08:54 -06:00
poc-cli
```
2022-02-17 12:56:18 -06:00
---
2022-02-12 03:08:54 -06:00
# My Old Notes Below!
2022-02-12 03:08:54 -06:00
2022-02-17 12:56:18 -06:00
---
2022-02-12 03:08:54 -06:00
2022-02-12 01:47:23 -06:00
# Pluggable CLI
- Each subcommand is a plugin?
- Versioning and/or stability will be important?
2022-02-17 12:56:18 -06:00
- Maybe plugins _never_ change and instead you prefix them with a version?
- How can we build stability into the system?
2022-02-12 01:47:23 -06:00
- Some subset or all plugins are already known
- Auto-download plugins when attempting to run a command
- Completions for subcommands
2022-02-17 12:56:18 -06:00
- Are completions provided for commands not-yet-installed? Does attempting to
complete a subcommand's commands install the plugin and process its
completions?
2022-02-12 01:47:23 -06:00
- Will have configuration
# Core functions
- What plugins are available to me?
2022-02-17 12:56:18 -06:00
- HTTP GET (and cache?) some known human- and machine-readable manifest
- JSON, YAML, Cue, or Ion?
2022-02-12 01:47:23 -06:00
- Install a plugin
2022-02-17 12:56:18 -06:00
- HTTP GET
2022-02-12 01:47:23 -06:00
- Delete a plugin
2022-02-17 12:56:18 -06:00
- rm -r dir
2022-02-12 01:47:23 -06:00
- Update self
2022-02-17 12:56:18 -06:00
- download new binary and replace self with it
2022-02-12 01:47:23 -06:00
- Update plugin
2022-02-17 12:56:18 -06:00
- replace plugin
2022-02-12 01:47:23 -06:00
- Run a plugin with some given arguments
2022-02-17 12:56:18 -06:00
- call plugin with args
2022-02-12 01:47:23 -06:00
# Components I See
- Core
2022-02-17 12:56:18 -06:00
- Knows where to find manifest (may cache locally)
- Installs, updates, deletes plugins using information in manifest
- Can update or uninstall itself
- Can run plugins
2022-02-12 01:47:23 -06:00
- Manifest
2022-02-17 12:56:18 -06:00
- Contains information about where to find plugins and their versions
2022-02-12 01:47:23 -06:00
- Plugins
2022-02-17 12:56:18 -06:00
- Probably dumb scripts that call fancier things
2022-02-12 13:18:25 -06:00
[upstream]: https://git.lyte.dev/lytedev/pluggable-cli-deno
[github]: https://github.com/lytedev/pluggable-cli-deno