Add Project: add-project

Use add-project to add a project to a StarTeam Server configuration from the command line. When a project is created, its root view and the root folder for the root view are also created. In this command, the -rp option specifies the working folder for that root folder.

Using -is allows you to use the working folder’s child folders as the root folder’s child folders in the StarTeam folder hierarchy.

Syntax

The syntax for this command is:

stcmd{Ex} add-project [-epwdfile "filePath"] [-cmp] 
[-encrypt encryptionType] [-is] [-q] -s "serverName" -name "projectName" 
-rp "folderPath" [-d "description"] [-kw "fileMask" |-kwfile "fileName"]
[-ex "excludeType"] [-exlist "fileMask" |-exfile "fileName"]
Parameter
Description
-epwdfile

The -epwdfile keyword specifies the path to the file that contains the encrypted password. Like -pwdfile , -epwdfile replaces the password being used as part of the -p or -s option, preventing others from seeing the user's password on the command line. The full syntax is: -epwdfile "filePath" .

The -pwdfile is supported for backward compatibility. Un-encrypted passwords stored using older versions of stcmd are read. However, passwords cannot be stored to files using -pwdfile anymore.

Note: When -epwdfile is used, a password should not be specified as part of the -p or -sparameter.

In this case, the syntax of -p or -s reduces to -p "username@hostname:port/... -epwdfile "fullyQualifiedPathToPasswordFile"".

The following is the syntax of the commands that can be used to store an encrypted password.

Use the following syntax to be prompted for the password that will be encrypted and stored in a file.

stcmd store-password -epwdfile "filePath"
Use the following syntax to include the encrypted password in the command as clear text.
Note: This action does not access the network with the clear value.
stcmd store-password -epwdfile "filePath" -password "password"

After an encrypted password is stored, other stcmd commands can specify -epwdfile "filePath"' as parameters. For example:

stcmd delete-local -p "JMarsh@Orion:1024/StarDraw/StarDraw/SourceCode" -epwdfile "C:\estuff\myfile.txt" -filter "N" "*"
Important:

If -p or -s and -epwdfile are used together, then the parameter :password must be omitted from -p. For example:

-p user@hostname:port/projectName.viewName -epwdfile "pathToPasswordFile"
-cmp

Compresses all the data sent between the workstation and the server and decompresses it when it arrives. Without this option, no compression takes place.

Compression speeds transmission across the network, but it takes time on the front end to compress the data and at the back end to decompress the data.

This is an optional parameter. If not specified, then the platform default is not to compress.

-encrypt

Encrypts all data sent between the workstation and the server and decrypts it when it arrives. Without this option, no encryption takes place. Encryption protects files, data and other project information from being read by unauthorized parties over unsecured networks.

This is an optional parameter. If not specified, then the server and the command line negotiate the encryption required by the server.

The full syntax is: -encrypt encryptionType.

The types of encryption are:

RC4
RSA RC4 stream cipher (fast).
RC2_ECB
RSA RC2 block cipher (Electronic Codebook).
RC2_CBC
RSA RC2 block cipher (Cipher Block Chaining).

These encryption types are ordered from fastest to slowest. Each of the slower encryption types is safer than the one preceding it.

Note: For platforms other than Microsoft Windows, the public and private keys used in the encryption process are not created automatically. They are stored in a file in the user’s home directory. This options file is named .starteam. It contains a variable or shell variable called keyfile. The keyfile variable specifies the location of the file that contains the public and private keys. If you do not specify the keyfile variable, an error occurs. When you specify the keyfile variable, but the file does not exist, the StarTeam Cross-Platform Client generates a random pair of keys, creates the file, and stores the keys in it. Be sure to secure this file. For example, in UNIX, only its owner should be able to read it.
-is
Applies the command to all child folders. Without this option, the command applies only to the specified folder. When this option is used with add-folder, you can add an entire branch of folders to the StarTeam folder hierarchy.

When used with add or ci, the command recursively visits all modified files in all sub-folders and checks them in.

-q
Enables quiet mode. The -q option is retained for backward compatibility with the old command line. If -q is specified, then -pf cannot be specified. The command will return no results.
-s

Identifies the StarTeam Server. The full syntax is: -s "userName:password@host:portNumber"

For example: -s "JMarsh:password@orion:49201"

If the user name is omitted, the current user name is used. The user name in the example is “JMarsh”.

If the password is omitted, the user is prompted to enter the password. The password in the example is “password”. If the host name is omitted, the default is localhost. The host name in the example is “orion”.

The port number is required. The default port number, 49201, is used in the example.

-name
Specifies the name. Maximum of 254 characters.
-nivf
If -nivf is included, then files in Not in View folders are also included in the action.
-rp

Overrides the working folder or working directory for the StarTeam view’s root folder.

While this option allows you to use a different working folder than the one specified by the StarTeam view, its critical importance is to provide cross-platform compatibility. For example, UNIX and Microsoft Windows systems specify drive and directory path names in incompatible ways.

While the path D:\MYPRODUCT\DEVELOPMENT\SOURCE is understood on a Microsoft Windows platform, it is not understood on a UNIX platform. Use this option to define the working path if your platform does not understand the path specified in the StarTeam project.

The UNIX shell interprets a backslash (\) as an escape character when it precedes certain characters, such as quotation marks. As a result, an error occurs in the following example:

stcmd ci -p "xxx" -rp "C:\" "*"

which is interpreted as:

stcmd ci -p "xxx" -rp "C:" *"

To avoid a situation like this, escape the final character in "C:\" as follows:

stcmd ci -p "xxx" -rp "C:\\" "*"

Or avoid it as follows when the -rp path doesn’t end with the root folder as in "C:\orion\":

stcmd ci -p "xxx" -rp "C:\orion" "*"

The full syntax is: -rp "folderName" .

Folder is the Microsoft Windows term and appears in the StarTeam user interface. Directory is the correct term for the UNIX platform.

-d
A user specified Description. However, we continue to support -r as an alternate to -d for the description, but strictly for backward compatibility
-kw
Specifies the file extensions with which you want to use keywords. Use a maximum of 254 characters. Enter one or more file specifications (using the standard * and ? wild cards), separated by commas, spaces, or semicolons.

To include a comma, space, or semicolon as part of the specification, enclose the specification in double quotation marks. For example: *.cpp,*.h p*z.doc;*.t?t "test *.*"

If you are using double-quotation marks in your keyword list or have a lengthy list, we recommend that you use the -kwfile option. With -kwlist, each quotation mark in the keyword list needs to be preceded by the escape character for your system or shell. For example, the caret (^) works on NT systems. With -kwfile, you do not need to use escape characters.

-kwfile
Specifies the path to the file containing the file extensions with which you want to use keywords. If you use -kwfile, you cannot use -kw.
-ex

Indicates the exclude lists to be used by this new folder. Exclude lists exclude certain files or types of files from visibility. If a working file in this folder’s working folder would have the status Not In View but it matches a file specification in one of the exclude lists, the application does not display it at all. It is as though the file did not exist.

For example, suppose you are creating files in an application that makes automatic backup copies of each file (with the extension .bak) every time you save a file. Your working folder might contain several .bak files, but you have no reason to add them to the project view. From the application, it is annoying to see these .bak files as possible candidates, so you exclude them. Excluding files is done on a per-folder basis. However, exclude lists can be inherited from parent folders.

The full syntax is: -ex excludeType

The types include:

inherit
This folder will inherit any exclude lists used by its parent folder and use the exclude list specified with either -exfile or -exlist (if one is created). This is the default.
local
This folder will use only the exclude list specified with either-exfile or -exlist.
none
This folder will use no exclude lists, regardless of what you specify with either -exfile or -exlist.
-exlist

Specifies the local exclude list for this folder. Use a maximum of 254 characters. Enter one or more file specifications (using the standard * and ? wild cards), separated by commas, spaces, or semicolons. To include a comma, space, or semicolon as part of the specification, enclose the specification in double quotation marks: *.exe,*.dll p*z.doc;*.t?t "test *.*"

If you are using double-quotation marks in your exclude list or have a lengthy exclude list, we recommend that you use the -exfile option. With -exlist, each quotation mark in the exclude list needs to be preceded by the escape character for your system or shell. For example, the caret (^) works on NT systems. With-exfile , you do not need to use escape characters.

-exfile
Specifies the path to the file that contains the local exclude list for this folder. See -exlist for a description of the exclude list’s contents.

Example

The following example uses add-project to create a project named Integrations on the computer named Orion. (Orion is running an instance of the StarTeam Server with a server configuration that uses port 1024.) This command creates the project, specifies that the data sent between workstations and the server should be compressed and encrypted, and gives the project a description.

stcmd add-project -s "JMarsh:password@Orion:1024" -cmp -encrypt "RC4" 
-name "Integrations" -rp "C:\integrations" -d "integrations between our 
products and our partner’s products"