How to create Uipath Project nuget package in command line

Hi,

How do i mimic the publish to create a nuget package using the command line ?.

When i executed nuget pack project.json it says nothing found in bin.

I tried creating a nuspec file with the details and then it worked. How do i make it work with just the project.json?

Thanks
Kiran

1 Like

https://www.uipath.com/kb-articles/publish-and-run-a-project-package

Please check this link. hope you will find your answer.

Publishing Projects from the Command Line

You can publish projects using the UiPath.Studio.CommandLine.exe publish command.

UiPath.Studio.CommandLine.exe is available in the installation folder:

  • For per-machine installations, the default path is C:\Program Files\UiPath\Studio.
  • For per-user installations, the default path is %localappdata%\Programs\UiPath\Studio.

The following arguments are available for the publish command:

Argument Description
-p, --project-path The path to the project.json to publish. The argument is mandatory.
-g, --target Where to publish the project:
  • Custom - Custom URL or local folder. Define the location using the -f, --feed argument.
  • Robot - Default publish location for the Robot, if not connected to Orchestrator. Not available for publishing libraries or templates.
  • OrchestratorTenant - Orchestrator Tenant Processes Feed (for processes and test cases) or Orchestrator Libraries Feed (for libraries and templates).
  • OrchestratorPersonalFolder - Orchestrator Personal Workspace Feed. Not available for publishing libraries, templates, or test cases.
  • OrchestratorFolderHierarchy - If a first-level folder with a separate package feed or one if its subfolders is selected from the folders menu in the Studio status bar, the feed for that folder hierarchy. Not available for publishing libraries or templates.|
    |-f, --feed|The custom URL for publishing the project. This can also be a custom local directory, similar to the path in the Publish options tab in Studio.|
    |-a, --api-key|The API key for publishing the project. This argument can be used for a custom target.|
    |-i, --icon|Path to the custom icon to use for the package.|
    |-n, --notes|Release notes that contain changes brought to the project.|
    |-v, --new-version|The new version for the project. If not provided, the version is automatically incremented.|
    |-t, --timeout|Specifies the timeout value for publishing projects. The default timeout is 30 seconds. This setting only applies for the package transfer to Orchestrator duration.|
    |–cer-path|The local path to the certificate for package signing.|
    |–cer-password|The password for the certificate.|
    |–timestamper-url|The URL to the timestamper.|
    |–incl-all-feeds|Not required.|
    |–help|View the arguments available for each command.|
    |–version|Check the version of UiPath.Studio.CommandLine.exe.|

For example:

  • The following command publishes the Sample process to the Orchestrator Tenant Processes Feed:

UiPath.Studio.CommandLine.exe publish --project-path “C:\Users\username\Documents\UiPath\Sample\project.json” --target OrchestratorTenant --notes “Fixed a couple of bugs.”

  • The following command publishes the same process to a local folder:

UiPath.Studio.CommandLine.exe publish --project-path “C:\Users\username\Documents\UiPath\Sample\project.json” --target Custom --feed “C:\Users\username\Desktop\myfeed” --notes “Fixed a couple of bugs.”

For more information about the CommandLine.exe utility, see Mass Update Command Line Parameters.

1 Like

Kiran, did you end up finding out how to do this?
I’m also after this functionality, essentially building the project using build tools taking the project from source repository.

Hi, I would like to ask if there is other method to package the file other than using the studio itself, i.e. via command line?

Found Nothing yet

Checking on this again. Anyone find a solution to this?

Just trying my luck here, Did any solution come up for this?

There are many package creation tools available. you can opt these apps to build nuget package via commandline

Hi @kiran_kumar_sukumar

Open Command Prompt and navigate to the directory where the Robot.exe file is saved and use the below command
For Example
c:\Program Files (x84)\UiPath\Studio> UiRobot.exe -pack “C:\UiPath\Projects\Notepad\project.json” -o “destination file”. Click on enter.

This will create a nuget package of your project in the destination path you have specified above.

Refer the link :https://robot.uipath.com/docs/arguments-description

6 Likes

Hi,

Step 1: Navigate to UiRobot.exe

For community edition, navigate to "%localappdata% then “\Local\UiPath\app-18.x.x\UiRobot.exe”
For enterprise edition, navigate to “C:\Program Files (x86)\UiPath\Studio\UiRobot.exe”

Step 2: Copy the source project.json path
example: “D:\Process\CASA_2019\project.json”

Step 3: Copy the destination folder path
example : “D:\Process”

Step 4: Define the package version as per the organization standard
example: “15.03.2019”

Note: version only accepts numeric characters and period “.”
The format M.m.bbbb.rrrrr , where:

M is the major version.
m is the minor version.
bbbb is the build version.
rrrrr is the revision version.

Run the below command and it will create a nuget package with projectname.version.nupkg

cmd : C:\Users\John\AppData\Local\UiPath\app-18.4.2>uirobot.exe -pack “D:\Process\CASA_2019\project.json” -o “D:\Process” -v “15.03.2019”

output : Packed project ‘D:\Process\CASA_2019\project.json’ to ‘D:\Process\CASA_2019.15.03.2019.nupkg’

Note: This packaging command is available from 2018.3 only, previous version robots will not support this.

Thanks
John Felix

6 Likes

Thank you so much!

Newer version of UiPath, I believe 2018.10 has been replaced by the mass tool.
Reference: UiPath.Studio.CommandLine.exe

For when packing locally, it’s a matter of combining publish with --feed or -f
Here’s an example:
–new-version or -v for specifying a version
–notes or -n for specifying a change log
“c:\Program Files (x86)\UiPath\Studio\UiPath.Studio.CommandLine.exe” publish --project-path c:\Workspace\RPA\Code\MyAutomationProject\project.json --feed c:\Temp --new-version 1.0.0-alpha003 --notes “Initial cut build 003”

2 Likes

Hallo Marc_Bourgeois,

I tried this publishing way using cmd but I keep getting error:

“Publish failed: Object reference not set to an instance of an object.”

Do you happen to know the reason for it?

Thanks