-
-
20 Nov 2016 17:43:08 UTC
- Distribution: API-CLI
- Module version: 0.001
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (486 / 0 / 19)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.10.0
- Activity
24 month- Tools
- Download (138.66KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors-
Tina Müller
NAME
API::CLI - Generic Framework for REST API Command Line Clients
SYNOPSIS
use API::CLI::App::Spec; package API::CLI::MetaCPAN; use base 'API::CLI'; sub add_auth { } package main; my $appspec_file = "$Bin/../metacpancl-appspec.yaml"; my $spec = API::CLI::App::Spec->read($appspec_file); my $runner = App::Spec::Run->new( spec => $spec, cmd => API::CLI::MetaCPAN->new( dir => "$ENV{HOME}/.githubcl", ), ); $runner->run;
DESCRIPTION
This is an experimental first version.
With API::CLI you can create a simple commandline client for any REST API which has an OpenAPI specification.
# 1. parameter: owner # 2. parameter: repo % githubcl GET /repos/:owner/:repo perlpunk API-CLI-p5
The generated help will show all methods, endpoints, parameters and options.
Query parameters are represented as command line options starting with
--q-
:% metacpancl GET /pod/:module App::Spec --q-content-type text/x-pod =head1 NAME App::Spec - Specification for commandline apps ...
It can also generate shell tab completion:
% metacpancl <TAB> GET -- GET call POST -- POST call help -- Show command help % digitaloceancl GET /<TAB> /account -- Account information /droplets -- List all droplets /droplets/:id -- Retrieve a droplet by id % metacpancl GET /pod/:module App::Spec --q-content-type text/<TAB> text/html text/plain text/x-markdown text/x-pod
Bash users: Note that completion for options and parameters currently does not work.
METHODS
- add_auth
- apicall
- dir
- read_appconfig
- openapi
SEE ALSO
- https://github.com/APIs-guru/openapi-directory
- App::Spec - Commandline Interface Framework
LICENSE
This library is free software and may be distributed under the same terms as perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 183:
You forgot a '=back' before '=head1'
Module Install Instructions
To install API::CLI, copy and paste the appropriate command in to your terminal.
cpanm API::CLI
perl -MCPAN -e shell install API::CLI
For more information on module installation, please visit the detailed CPAN module installation guide.