A cross-platform cli to illustrate interacting with VSTS.
npm install -g @robbiedhickey/vsts-demo-cli
This package consists of a basic framework powered by
oclif that enables a modular way to build multi-command CLIs. The feature set is currently minimal, but it will allow a user to initialize a connection to a TFS instance that they own or have access to, persist the credentials, and subsequently use the credentials in a later session to list the projects they have access to. The cli is also cross platform.
From a usability standpoint, the cli includes general and command-specific help output (i.e.
vsts-demo-cli help and
vsts-demo-cli help init). The cli also displays spinners with contextual messages during asynchronous operations. When errors occur in a multi-step operation, the spinners will indicate which step(s) failed, provide a more detailed error message, and terminate the process. For commands that include flags like
vsts-demo-cli init, the cli supports both passing of the parameters explicitly as well as an interactive mode which will prompt the user for input in a guided questionnaire. The questionnaire will also perform some basic validation to help the user fall into the pit of success. The cli can also output ascii-tables to the console, which is demonstrated with the
vsts-demo-cli projects:list command. Finally, a user can use
vsts-demo-cli clear to purge their stored configuration settings.
From a technical standpoint, the project illustrates some basic usage of
oclif test framework, and includes configuration for linting and measuring test coverage. If you can't live without a static type system,
oclif also comes bundled with type declarations and embraces TypeScript in their documentation.
$ npm install -g @robbiedhickey/vsts-demo-cli $ vsts-demo-cli COMMAND running command... $ vsts-demo-cli (-v|--version|version) @robbiedhickey/vsts-demo-cli/2.3.2 darwin-x64 node-v8.9.0 $ vsts-demo-cli --help [COMMAND] USAGE $ vsts-demo-cli COMMAND ...
clears the stored user configuration settings
USAGE $ vsts-demo-cli clear
See code: src/commands/clear.js
vsts-demo-cli help [COMMAND]
display help for vsts-demo-cli
USAGE $ vsts-demo-cli help [COMMAND] ARGUMENTS COMMAND command to show help for OPTIONS --all see all commands in CLI
See code: @oclif/plugin-help
initializes cli against a vsts instance
USAGE $ vsts-demo-cli init OPTIONS -t, --token=token personal access token for your vsts instance -u, --url=url url of the vsts instance (i.e. https://myvsts.visualstudio.com) DESCRIPTION Persists VSTS configuration and user data to make future uses of the utility seamless.
See code: src/commands/init.js
lists all vsts projects the user has access to
USAGE $ vsts-demo-cli projects:list
See code: src/commands/projects/list.js