Introduction TeamCity command line tool allows you to start Personal Builds from the command line. Supported VCS The tool allows to run Personal Builds for sources under the SVN, CVS, Perforce and TFS source control systems. Requirements The tool is distributed as executable .jar and requires JRE only. Installing The tool does not require any installation. Running java -jar tcc.jar Quick start Help: The tool contains help for each supported command. You can get the list of commands by: java -jar tcc.jar help A detailed command description is available too: java -jar tcc.jar help Authorization: To perform the most of TeamCity operations you must point specify the TeamCity Server to operate with as well as username and password. This can be done with help of "--host", "--user" and "--password" options. You can specify "--user" and "--password" for each run or use "login" command. The "login" command persists credentials for target host so you can avoid authorization options for subsequent starts. See help for "login" for more details. All examples below were ran after the "login" was executed. NOTE: last logged in is treated as Default and will be used if "--host" key is omitted. Mappings: First of all you have to prepare TeamCity mapping which helps TeamCity Server exactly associate local resources to resources the Server can operate to. The mapping's supported with special files calling ".teamcity-mappings.properties". A ".teamcity-mappings.properties" must contain pairs of local paths and remote VCS Root's prefixes. A local path can be absolute or relative. In this case the relative path will be treated as path against mapping file's folder location and expanded to absolute in runtime. There are several places you can place these files. The first of all it's a folder contains changes you will pass Remote Run to. It's a first place the tool will seek for mapping file in runtime. The tool scans whole parent folder hierarchy a mappings files for. A Default Teamcity Mapping supported also and expected in the "%HOME%/.TeamCity-CommandLine" folder. File name is same. You can override these Per-folder and Default mappings with "--config-file " option of "run" command. NOTE: Especial TeamCity server's plugin'll help you to prepare content of mapping files. Look at "My Settings & Tools/CommandLineRemoteRun/Configure". Discover TeamCity Server structure: The "info" command can provide you with short information about TeamCity Server's Projects, Configurations and VCS roots: java -jar tcc.jar info --host http://rusps-app:80 -p a result of invocation is a list of existing TC projects, like this: id name status description project3 tc_test NORMAL tc_test project2 tc_test_2 FAILURE tc_test_2 next you can get configurations of project "tc_test" for example: java -jar tcc.jar info --host http://rusps-app:80 -c -p project3 the tool prints configurations that belong to the project "tc_test": id name status description bt9 tc-test-perforce NORMAL bt5 tc-test-svn NORMAL bt7 tc-test-svn-2 NORMAL bt8 test-CVS NORMAL Remote Run: So we have all required information and prepared Share to perform Remote Run. Let's start a Remote Run for changed files located in the shared folder "C:\work\tc-test\tc-test-rusps-app-svn" on Configuration "bt7": java -jar tcc.jar run --host http://rusps-app -c bt7 C:\work\tc-test\tc-test-rusps-app-svn the command collects all files from the folder recursively and sends them to TeamCity Server for Remote Run. You can specify files for execution more accurately and such form allows you to send deleted files too: java -jar tcc.jar run --host http://rusps-app -c bt7 C:\work\tc-test\tc-test-rusps-app-svn\src\all\New.java C:\work\tc-test\tc-test-rusps-app-svn\src\all\ENew.java You can also pass a file with list of changed files: java -jar tcc.jar run --host http://rusps-app -c bt7 @C:\work\tc-test\tc-test-rusps-app-svn\src\all\changes.txt changes.txt content: C:\work\tc-test\tc-test-rusps-app-svn\src\all\ENew.java C:\work\tc-test\tc-test-rusps-app-svn\src\all\New.java Such file can be prepared with help of SCM own tools. By default the "run" command will wait for the build to finish and returns code corresponding to the status of the build. This exit code can be used to perform a commit.