Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Replace @oclif/command to @oclif/core library #553

Open
wants to merge 13 commits into
base: drop-support-node
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
tmp/
coverage/
10 changes: 6 additions & 4 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ globals:
plugins:
- promise
- unicorn
- node
- n

extends:
- 'eslint:recommended'
- 'plugin:promise/recommended'
- 'plugin:unicorn/recommended'
- 'plugin:node/recommended'
- 'plugin:n/recommended'
# - 'oclif'
congminh1254 marked this conversation as resolved.
Show resolved Hide resolved
- 'prettier'

rules:

Expand Down Expand Up @@ -328,8 +330,8 @@ rules:
unicorn/no-new-buffer: error

### NODE
node/no-deprecated-api: error
node/exports-style:
n/no-deprecated-api: error
n/exports-style:
- error
- module.exports

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ typings/
#Intelij Idea
*.iml
.idea

# Oclif Build files
tmp/
3 changes: 3 additions & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
recursive: true
timeout: '10000'
reporter: 'spec'
6 changes: 1 addition & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"tabWidth": 2,
"useTabs": true,
"singleQuote": true
}
"@oclif/prettier-config"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Avatar URL: 'https://app.box.com/api/avatar/large/77777'
* [`box tokens`](docs/tokens.md) - Get a token. Returns the service account token by default
* [`box trash`](docs/trash.md) - List all items in trash
* [`box users`](docs/users.md) - List all Box users
* [`box version`](docs/version.md)
* [`box watermarking`](docs/watermarking.md) - Apply a watermark on an item
* [`box web-links`](docs/web-links.md) - Manage web links
* [`box webhooks`](docs/webhooks.md) - List all webhooks
Expand Down
9 changes: 6 additions & 3 deletions bin/run
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env node

require('@oclif/command').run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'))
const { handle } = require('@oclif/core/errors');
const flush = require('@oclif/core/flush');

require('@oclif/core').run()
.then(flush)
.catch(handle);
109 changes: 55 additions & 54 deletions docs/ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@

Sends an AI request to supported LLMs and returns an answer

- [`box ai`](#box-ai)
- [`box ai:ask`](#box-aiask)
- [`box ai:text-gen`](#box-aitext-gen)
* [`box ai:ask`](#box-aiask)
* [`box ai:text-gen`](#box-aitext-gen)

## `box ai:ask`

Sends an AI request to supported LLMs and returns an answer

```
USAGE
$ box ai:ask

OPTIONS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=token Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=as-user Provide an ID for a user
--bulk-file-path=bulk-file-path File path to bulk .csv or .json objects
--csv Output formatted CSV
--fields=fields Comma separated list of fields to show
--items=items (required) The items for the AI request
--json Output formatted JSON
--no-color Turn off colors for logging
--prompt=prompt (required) The prompt for the AI request
--save-to-file-path=save-to-file-path Override default file path to save report

EXAMPLE
box ai:ask --items=id=12345,type=file --prompt "What is the status of this document?"
$ box ai:ask --prompt <value> --items <value>... [-t <value>] [--as-user <value>] [--no-color] [--json |
--csv] [-s | --save-to-file-path <value>] [--fields <value>] [--bulk-file-path <value>] [-h] [-v] [-y] [-q]

FLAGS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=<value> Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=<value> Provide an ID for a user
--bulk-file-path=<value> File path to bulk .csv or .json objects
--csv Output formatted CSV
--fields=<value> Comma separated list of fields to show
--items=<value>... (required) The items for the AI request
--json Output formatted JSON
--no-color Turn off colors for logging
--prompt=<value> (required) The prompt for the AI request
--save-to-file-path=<value> Override default file path to save report

DESCRIPTION
Sends an AI request to supported LLMs and returns an answer

EXAMPLES
$ box ai:ask --items=id=12345,type=file --prompt "What is the status of this document?"
```

_See code: [src/commands/ai/ask.js](https://github.com/box/boxcli/blob/v3.16.0/src/commands/ai/ask.js)_
Expand All @@ -44,36 +47,34 @@ Sends an AI request to supported LLMs and returns an answer specifically focused

```
USAGE
$ box ai:text-gen

OPTIONS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=token Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=as-user Provide an ID for a user
--bulk-file-path=bulk-file-path File path to bulk .csv or .json objects
--csv Output formatted CSV
--dialogue-history=dialogue-history The history of prompts and answers previously passed to the LLM.
--fields=fields Comma separated list of fields to show

--items=items (required) The items to be processed by the LLM, often files. The array can
include exactly one element.

--json Output formatted JSON

--no-color Turn off colors for logging

--prompt=prompt (required) The prompt for the AI request

--save-to-file-path=save-to-file-path Override default file path to save report

EXAMPLE
box ai:text-gen --dialogue-history=prompt="What is the status of this document?",answer="It is in
review",created-at="2024-07-09T11:29:46.835Z" --items=id=12345,type=file --prompt="What is the status of this
document?"
$ box ai:text-gen --items <value>... --prompt <value> [-t <value>] [--as-user <value>] [--no-color] [--json |
--csv] [-s | --save-to-file-path <value>] [--fields <value>] [--bulk-file-path <value>] [-h] [-v] [-y] [-q]
[--dialogue-history <value>...]

FLAGS
-h, --help Show CLI help
-q, --quiet Suppress any non-error output to stderr
-s, --save Save report to default reports folder on disk
-t, --token=<value> Provide a token to perform this call
-v, --verbose Show verbose output, which can be helpful for debugging
-y, --yes Automatically respond yes to all confirmation prompts
--as-user=<value> Provide an ID for a user
--bulk-file-path=<value> File path to bulk .csv or .json objects
--csv Output formatted CSV
--dialogue-history=<value>... The history of prompts and answers previously passed to the LLM.
--fields=<value> Comma separated list of fields to show
--items=<value>... (required) The items to be processed by the LLM, often files. The array can include
exactly one element.
--json Output formatted JSON
--no-color Turn off colors for logging
--prompt=<value> (required) The prompt for the AI request
--save-to-file-path=<value> Override default file path to save report

DESCRIPTION
Sends an AI request to supported LLMs and returns an answer specifically focused on the creation of new text.

EXAMPLES
$ box ai:text-gen --dialogue-history=prompt="What is the status of this document?",answer="It is in review",created-at="2024-07-09T11:29:46.835Z" --items=id=12345,type=file --prompt="What is the status of this document?"
```

_See code: [src/commands/ai/text-gen.js](https://github.com/box/boxcli/blob/v3.16.0/src/commands/ai/text-gen.js)_
18 changes: 13 additions & 5 deletions docs/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,31 @@ Display autocomplete installation instructions

## `box autocomplete [SHELL]`

display autocomplete installation instructions
Display autocomplete installation instructions.

```
USAGE
$ box autocomplete [SHELL]
$ box autocomplete [SHELL] [-r]

ARGUMENTS
SHELL shell type
SHELL (zsh|bash|powershell) Shell type

OPTIONS
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)

DESCRIPTION
Display autocomplete installation instructions.

EXAMPLES
$ box autocomplete

$ box autocomplete bash

$ box autocomplete zsh

$ box autocomplete powershell

$ box autocomplete --refresh-cache
```

_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v0.1.0/src/commands/autocomplete/index.ts)_
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.11/src/commands/autocomplete/index.js)_
Loading
Loading