API-CLI

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either
    with or without modifications, to be licensed at no charge to all
    third parties under the terms of this General Public License (except
    that you may choose to grant warranty protection to some or all
    third parties, at your option).

    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

LICENSE  view on Meta::CPAN

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or (at your option)
    any later version.

LICENSE  view on Meta::CPAN

    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19xx name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License.  Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your

examples/bash/githubcl.bash  view on Meta::CPAN

                case ${MYWORDS[$INDEX-1]} in
                  --data-file)
                  ;;

                esac
                ;;
            esac
          ;;
          /legacy/repos/search/:keyword)
            FLAGS+=()
            OPTIONS+=('--q-order' 'The sort field. if sort param is provided. Can be either asc or desc.' '--q-language' 'Filter results by language' '--q-start_page' 'The page number to fetch' '--q-sort' 'The sort field. One of stars, forks, or upda...
            __githubcl_handle_options_flags
              case $INDEX in
              2)
                  __comp_current_options || return
              ;;
              *)
                __comp_current_options true || return # after parameters
                case ${MYWORDS[$INDEX-1]} in
                  --data-file)
                  ;;
                  --q-order)
                    _githubcl_compreply "'desc'"$'\n'"'asc'"
                  ;;
                  --q-language)
                  ;;
                  --q-start_page)
                  ;;
                  --q-sort)
                    _githubcl_compreply "'updated'"$'\n'"'stars'"$'\n'"'forks'"
                  ;;

                esac
                ;;
            esac
          ;;
          /legacy/user/email/:email)

examples/bash/githubcl.bash  view on Meta::CPAN

                case ${MYWORDS[$INDEX-1]} in
                  --data-file)
                  ;;

                esac
                ;;
            esac
          ;;
          /legacy/user/search/:keyword)
            FLAGS+=()
            OPTIONS+=('--q-order' 'The sort field. if sort param is provided. Can be either asc or desc.' '--q-start_page' 'The page number to fetch' '--q-sort' 'The sort field. One of stars, forks, or updated. Default: results are sorted by best mat...
            __githubcl_handle_options_flags
              case $INDEX in
              2)
                  __comp_current_options || return
              ;;
              *)
                __comp_current_options true || return # after parameters
                case ${MYWORDS[$INDEX-1]} in
                  --data-file)
                  ;;
                  --q-order)
                    _githubcl_compreply "'desc'"$'\n'"'asc'"
                  ;;
                  --q-start_page)
                  ;;
                  --q-sort)
                    _githubcl_compreply "'updated'"$'\n'"'stars'"$'\n'"'forks'"
                  ;;

                esac
                ;;
            esac
          ;;
          /meta)

examples/bash/githubcl.bash  view on Meta::CPAN

                  ;;

                esac
                ;;
            esac
          ;;
          /repos/:owner/:repo/commits)
            FLAGS+=()
            OPTIONS+=('--q-since' 'The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
Example: "2012-10-09T23:39:01Z".
' '--q-sha' 'Sha or branch to start listing commits from.' '--q-path' 'Only commits containing this file path will be returned.' '--q-author' 'GitHub login, name, or email by which to filter by commit author.' '--q-until' 'ISO 8601 Date - Only commit...
            __githubcl_handle_options_flags
              case $INDEX in
              2)
                  __comp_current_options || return
              ;;
              3)
                  __comp_current_options || return
              ;;
              *)
                __comp_current_options true || return # after parameters

examples/githubcl-appspec.yaml  view on Meta::CPAN

            schema:
              $ref: '#/definitions/search-issues-by-keyword'
          '403':
            description: |
              API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting
              for details.
    /legacy/repos/search/{keyword}:
      get:
        description: Find repositories by keyword. Note, this legacy method does not
          follow the v3 pagination pattern. This method returns up to 100 results
          per page and pages can be fetched using the start_page parameter.
        parameters:
        - description: The search term
          in: path
          name: keyword
          required: true
          type: string
        - default: desc
          description: The sort field. if sort param is provided. Can be either asc
            or desc.
          enum: &6

examples/githubcl-appspec.yaml  view on Meta::CPAN

          - asc
          in: query
          name: order
          type: string
        - description: Filter results by language
          in: query
          name: language
          type: string
        - description: The page number to fetch
          in: query
          name: start_page
          type: string
        - description: 'The sort field. One of stars, forks, or updated. Default:
            results are sorted by best match.'
          enum: &7
          - updated
          - stars
          - forks
          in: query
          name: sort
          type: string

examples/githubcl-appspec.yaml  view on Meta::CPAN

          description: The sort field. if sort param is provided. Can be either asc
            or desc.
          enum: &8
          - desc
          - asc
          in: query
          name: order
          type: string
        - description: The page number to fetch
          in: query
          name: start_page
          type: string
        - description: 'The sort field. One of stars, forks, or updated. Default:
            results are sorted by best match.'
          enum: &9
          - updated
          - stars
          - forks
          in: query
          name: sort
          type: string

examples/githubcl-appspec.yaml  view on Meta::CPAN

          in: path
          name: repo
          required: true
          type: string
        - description: |
            The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
            Example: "2012-10-09T23:39:01Z".
          in: query
          name: since
          type: string
        - description: Sha or branch to start listing commits from.
          in: query
          name: sha
          type: string
        - description: Only commits containing this file path will be returned.
          in: query
          name: path
          type: string
        - description: GitHub login, name, or email by which to filter by commit author.
          in: query
          name: author

examples/githubcl-appspec.yaml  view on Meta::CPAN

              $ref: '#/definitions/codeFrequencyStats'
          '403':
            description: |
              API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting
              for details.
    /repos/{owner}/{repo}/stats/commit_activity:
      get:
        description: |
          Get the last year of commit activity data.
          Returns the last year of commit activity grouped by week. The days array
          is a group of commits per day, starting on Sunday.
        parameters:
        - description: Name of repository owner.
          in: path
          name: owner
          required: true
          type: string
        - description: Name of repository.
          in: path
          name: repo
          required: true

examples/githubcl-appspec.yaml  view on Meta::CPAN

        - enum: *6
          name: q-order
          required: ~
          summary: The sort field. if sort param is provided. Can be either asc or
            desc.
          type: string
        - name: q-language
          required: ~
          summary: Filter results by language
          type: string
        - name: q-start_page
          required: ~
          summary: The page number to fetch
          type: string
        - enum: *7
          name: q-sort
          required: ~
          summary: 'The sort field. One of stars, forks, or updated. Default: results
            are sorted by best match.'
          type: string
        parameters:

examples/githubcl-appspec.yaml  view on Meta::CPAN

          type: string
        summary: This API call is added for compatibility reasons o...
      /legacy/user/search/:keyword:
        options:
        - enum: *8
          name: q-order
          required: ~
          summary: The sort field. if sort param is provided. Can be either asc or
            desc.
          type: string
        - name: q-start_page
          required: ~
          summary: The page number to fetch
          type: string
        - enum: *9
          name: q-sort
          required: ~
          summary: 'The sort field. One of stars, forks, or updated. Default: results
            are sorted by best match.'
          type: string
        parameters:

examples/githubcl-appspec.yaml  view on Meta::CPAN

      /repos/:owner/:repo/commits:
        options:
        - name: q-since
          required: ~
          summary: |
            The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
            Example: "2012-10-09T23:39:01Z".
          type: string
        - name: q-sha
          required: ~
          summary: Sha or branch to start listing commits from.
          type: string
        - name: q-path
          required: ~
          summary: Only commits containing this file path will be returned.
          type: string
        - name: q-author
          required: ~
          summary: GitHub login, name, or email by which to filter by commit author.
          type: string
        - name: q-until

examples/githubcl-openapi.yaml  view on Meta::CPAN

        '200':
          description: OK
          schema:
            $ref: '#/definitions/search-issues-by-keyword'
        '403':
          description: |
            API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting
            for details.
  '/legacy/repos/search/{keyword}':
    get:
      description: 'Find repositories by keyword. Note, this legacy method does not follow the v3 pagination pattern. This method returns up to 100 results per page and pages can be fetched using the start_page parameter.'
      parameters:
        - description: The search term
          in: path
          name: keyword
          required: true
          type: string
        - default: desc
          description: The sort field. if sort param is provided. Can be either asc or desc.
          enum:
            - desc
            - asc
          in: query
          name: order
          type: string
        - description: Filter results by language
          in: query
          name: language
          type: string
        - description: The page number to fetch
          in: query
          name: start_page
          type: string
        - description: 'The sort field. One of stars, forks, or updated. Default: results are sorted by best match.'
          enum:
            - updated
            - stars
            - forks
          in: query
          name: sort
          type: string
        - description: |

examples/githubcl-openapi.yaml  view on Meta::CPAN

        - default: desc
          description: The sort field. if sort param is provided. Can be either asc or desc.
          enum:
            - desc
            - asc
          in: query
          name: order
          type: string
        - description: The page number to fetch
          in: query
          name: start_page
          type: string
        - description: 'The sort field. One of stars, forks, or updated. Default: results are sorted by best match.'
          enum:
            - updated
            - stars
            - forks
          in: query
          name: sort
          type: string
        - description: |

examples/githubcl-openapi.yaml  view on Meta::CPAN

          in: path
          name: repo
          required: true
          type: string
        - description: |
            The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
            Example: "2012-10-09T23:39:01Z".
          in: query
          name: since
          type: string
        - description: Sha or branch to start listing commits from.
          in: query
          name: sha
          type: string
        - description: Only commits containing this file path will be returned.
          in: query
          name: path
          type: string
        - description: 'GitHub login, name, or email by which to filter by commit author.'
          in: query
          name: author

examples/githubcl-openapi.yaml  view on Meta::CPAN

            $ref: '#/definitions/codeFrequencyStats'
        '403':
          description: |
            API rate limit exceeded. See http://developer.github.com/v3/#rate-limiting
            for details.
  '/repos/{owner}/{repo}/stats/commit_activity':
    get:
      description: |
        Get the last year of commit activity data.
        Returns the last year of commit activity grouped by week. The days array
        is a group of commits per day, starting on Sunday.
      parameters:
        - description: Name of repository owner.
          in: path
          name: owner
          required: true
          type: string
        - description: Name of repository.
          in: path
          name: repo
          required: true

examples/html/githubcl.html  view on Meta::CPAN

<h3 id="GET-legacy-repos-search-:keyword">GET /legacy/repos/search/:keyword</h3>

<pre><code>    githubcl GET /legacy/repos/search/:keyword [options] &lt;keyword&gt;</code></pre>

<p>Find repositories by keyword. Note, this legacy me...</p>

<p>Options:</p>

<pre><code>    --q-order         The sort field. if sort param is provided. Can be either asc or desc.                      
    --q-language      Filter results by language                                                                 
    --q-start_page    The page number to fetch                                                                   
    --q-sort          The sort field. One of stars, forks, or updated. Default: results are sorted by best match.</code></pre>

<p>Parameters:</p>

<pre><code>    keyword  *  The search term</code></pre>

<h3 id="GET-legacy-user-email-:email">GET /legacy/user/email/:email</h3>

<pre><code>    githubcl GET /legacy/user/email/:email &lt;email&gt;</code></pre>

examples/html/githubcl.html  view on Meta::CPAN


<h3 id="GET-legacy-user-search-:keyword">GET /legacy/user/search/:keyword</h3>

<pre><code>    githubcl GET /legacy/user/search/:keyword [options] &lt;keyword&gt;</code></pre>

<p>Find users by keyword.</p>

<p>Options:</p>

<pre><code>    --q-order         The sort field. if sort param is provided. Can be either asc or desc.                      
    --q-start_page    The page number to fetch                                                                   
    --q-sort          The sort field. One of stars, forks, or updated. Default: results are sorted by best match.</code></pre>

<p>Parameters:</p>

<pre><code>    keyword  *  The search term</code></pre>

<h3 id="GET-meta">GET /meta</h3>

<pre><code>    githubcl GET /meta</code></pre>

examples/html/githubcl.html  view on Meta::CPAN

<h3 id="GET-repos-:owner-:repo-commits">GET /repos/:owner/:repo/commits</h3>

<pre><code>    githubcl GET /repos/:owner/:repo/commits [options] &lt;owner&gt; &lt;repo&gt;</code></pre>

<p>List commits on a repository.</p>

<p>Options:</p>

<pre><code>    --q-since     The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
                  Example: &quot;2012-10-09T23:39:01Z&quot;.                                                 
    --q-sha       Sha or branch to start listing commits from.                                     
    --q-path      Only commits containing this file path will be returned.                         
    --q-author    GitHub login, name, or email by which to filter by commit author.                
    --q-until     ISO 8601 Date - Only commits before this date will be returned.                  </code></pre>

<p>Parameters:</p>

<pre><code>    owner  *  Name of repository owner.
    repo   *  Name of repository.      </code></pre>

<h3 id="GET-repos-:owner-:repo-commits-:ref-status">GET /repos/:owner/:repo/commits/:ref/status</h3>

examples/pod/githubcl.pod  view on Meta::CPAN

=head3 GET /legacy/repos/search/:keyword

    githubcl GET /legacy/repos/search/:keyword [options] <keyword>

Find repositories by keyword. Note, this legacy me...

Options:

    --q-order         The sort field. if sort param is provided. Can be either asc or desc.                      
    --q-language      Filter results by language                                                                 
    --q-start_page    The page number to fetch                                                                   
    --q-sort          The sort field. One of stars, forks, or updated. Default: results are sorted by best match.

Parameters:

    keyword  *  The search term

=head3 GET /legacy/user/email/:email

    githubcl GET /legacy/user/email/:email <email>

examples/pod/githubcl.pod  view on Meta::CPAN


=head3 GET /legacy/user/search/:keyword

    githubcl GET /legacy/user/search/:keyword [options] <keyword>

Find users by keyword.

Options:

    --q-order         The sort field. if sort param is provided. Can be either asc or desc.                      
    --q-start_page    The page number to fetch                                                                   
    --q-sort          The sort field. One of stars, forks, or updated. Default: results are sorted by best match.

Parameters:

    keyword  *  The search term

=head3 GET /meta

    githubcl GET /meta

examples/pod/githubcl.pod  view on Meta::CPAN

=head3 GET /repos/:owner/:repo/commits

    githubcl GET /repos/:owner/:repo/commits [options] <owner> <repo>

List commits on a repository.

Options:

    --q-since     The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
                  Example: "2012-10-09T23:39:01Z".                                                 
    --q-sha       Sha or branch to start listing commits from.                                     
    --q-path      Only commits containing this file path will be returned.                         
    --q-author    GitHub login, name, or email by which to filter by commit author.                
    --q-until     ISO 8601 Date - Only commits before this date will be returned.                  

Parameters:

    owner  *  Name of repository owner.
    repo   *  Name of repository.      

=head3 GET /repos/:owner/:repo/commits/:ref/status

examples/zsh/_githubcl  view on Meta::CPAN

                            '3: :->keyword' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            '--q-order[The sort field. if sort param is provided. Can be either asc or desc.]:q-order:("desc" "asc")' \
                            '--q-language[Filter results by language]:q-language' \
                            '--q-start_page[The page number to fetch]:q-start_page' \
                            '--q-sort[The sort field. One of stars, forks, or updated. Default: results are sorted by best match.]:q-sort:("updated" "stars" "forks")' \
                            && ret=0

                        case $state in
                        keyword)

                        ;;
                        esac

                    ;;

examples/zsh/_githubcl  view on Meta::CPAN

                            '2: :->cmd2' \
                            '3: :->keyword' \
                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            '--q-order[The sort field. if sort param is provided. Can be either asc or desc.]:q-order:("desc" "asc")' \
                            '--q-start_page[The page number to fetch]:q-start_page' \
                            '--q-sort[The sort field. One of stars, forks, or updated. Default: results are sorted by best match.]:q-sort:("updated" "stars" "forks")' \
                            && ret=0

                        case $state in
                        keyword)

                        ;;
                        esac

                    ;;

examples/zsh/_githubcl  view on Meta::CPAN

                            '--data-file[File with data for POST/PUT/PATCH/DELETE requests]:data-file:_files' \
                            '--debug[debug]' \
                            '-d[debug]' \
                            '--verbose[verbose]' \
                            '-v[verbose]' \
                            '--help[Show command help]' \
                            '-h[Show command help]' \
                            '--q-since[The time should be passed in as UTC in the ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
Example: "2012-10-09T23:39:01Z".
]:q-since' \
                            '--q-sha[Sha or branch to start listing commits from.]:q-sha' \
                            '--q-path[Only commits containing this file path will be returned.]:q-path' \
                            '--q-author[GitHub login, name, or email by which to filter by commit author.]:q-author' \
                            '--q-until[ISO 8601 Date - Only commits before this date will be returned.]:q-until' \
                            && ret=0

                        case $state in
                        owner)

                        ;;
                        repo)

lib/API/CLI.pm  view on Meta::CPAN

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
C<--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:



( run in 0.278 second using v1.01-cache-2.11-cpan-0d8aa00de5b )