Hudson CLI

Starting 1.302, Hudson has a built-in CLI client that allows you to access Hudson from a script or from your shell. This is convenient for automation of routine tasks, bulk updates, trouble diagnosis, and so on.

Obtaining CLI

Hudson CLI is distributed inside hudson.war. Download it from http://yourserver.com/jnlpJars/hudson-cli.jar. In theory, the CLI jar is dependent on the version of Hudson, but in practice, we expect to be able to retain compatibility between different versions of Hudson.

Running CLI

The general syntax is as follows (the design is similar to tools like svn/git):

java -jar hudson-cli.jar [-s HUDSON_URL] command [options...] [arguments...]

HUDSON_URL can be specified via the environment variable $HUDSON_URL. The 'help' command will give you the list of the available commands, which depends on the server you are talking to.

Extending CLI

Plugins installed on Hudson server can add custom CLI commands to Hudson. See Writing CLI commands for more details.

Working with Credentials

Hudson CLI does not support credentials at the moment. If you have secured your Hudson installation (login with username and password) you just get a

java.io.IOException: Server returned HTTP response code: 403 for URL: http://HUDSON_SERVER/cli

Adding this feature is on the list.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. May 05, 2009

    Rémy EVEN says:

    What about protocol and port using by hudson-cli ? Thanks

    What about protocol and port using by hudson-cli ?

    Thanks

  2. May 19, 2009

    Frederic Jean says:

    Is it possible to pass credentials to hudson-cli?

    Is it possible to pass credentials to hudson-cli?

  3. Feb 04, 2010

    benson margulies says:

    Can I pass parameters to the 'build' command?

    Can I pass parameters to the 'build' command?

  4. Apr 09

    Axel Heider says:

    Is there a list of commands that can be used? I did not find anything, so if the...

    Is there a list of commands that can be used? I did not find anything, so if there is something a link in the Wiki page would help.

    1. May 03

      Jes struck says:

      use help as a command the it's self documented

      use help as a command the it's self documented

  5. May 24

    Thomas Matthijs says:

    The correct HUDSON_URL is your-url + "/cli", if you go that address the example ...

    The correct HUDSON_URL is your-url + "/cli", if you go that address the example there will even lie to you (not including /cli)