### Local Installation Success Output Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Example output indicating a successful global installation of the locally built tfx-cli package. ```bash /usr/local/bin/tfx -> /usr/local/lib/node_modules/tfx-cli/tfx-cli.js tfx-cli@0.1.8 /usr/local/lib/node_modules/tfx-cli ├── os-homedir@1.0.1 ├── async@1.4.2 ├── colors@1.1.2 ├── minimist@1.1.3 ├── node-uuid@1.4.3 ├── q@1.4.1 ├── validator@3.43.0 ├── shelljs@0.5.1 ├── vso-node-api@0.3.0 ├── read@1.0.6 (mute-stream@0.0.5) └── archiver@0.14.4 (buffer-crc32@0.2.5, lazystream@0.1.0, async@0.9.2, readable-stream@1.0.33, tar-stream@1.1.5, lodash@3.2.0, zip-stream@0.5.2, glob@4.3.5) ``` -------------------------------- ### Build Project Confirmation Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Example output from running the 'npm run build' command, confirming the build process. ```bash C:\tfs-cli>npm run build ``` -------------------------------- ### Install tfx-cli on Windows Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Installs the tfx-cli globally using npm on Windows systems. ```bash npm install -g tfx-cli ``` -------------------------------- ### Install TFS CLI Locally for Verification Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Installs the locally built TFS CLI product globally for verification purposes. This command should be run from the _build directory. ```bash ~/Projects/tfs-cli/_build$ sudo npm install ./app -g ``` -------------------------------- ### Example Verbose Output Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Illustrates the detailed logging output when the mock server's verbose logging is enabled. This includes request methods, paths, and authorization headers. ```text Mock DevOps server listening on http://localhost:8084 Mock Server: GET /_apis/connectionData - Authorization: Basic tes***ass Mock Server: POST /_apis/build/builds - Authorization: Bearer abc***xyz Mock DevOps server closed ``` -------------------------------- ### Example Verbose Mock Server Output Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Illustrates the detailed output generated when mock server verbose logging is enabled, including server lifecycle events, HTTP requests with obscured authorization headers, and request processing details. ```text Mock DevOps server listening on http://localhost:8084 Mock Server: GET /_apis/connectionData - Authorization: Basic tes***ass [Mock Server] Handling connection data request [Mock Server] Providing resource areas for service discovery Mock Server: POST /_apis/wit/workitems/$Bug - Authorization: Bearer abc***xyz [Mock Server] Creating work item of type Bug [Mock Server] Work item created with ID: 1001 Mock DevOps server closed Mock DevOps server stopped ``` -------------------------------- ### Install tfx-cli on Linux/OSX Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Installs the tfx-cli globally using npm on Linux or macOS systems. ```bash sudo npm install -g tfx-cli ``` -------------------------------- ### Install TypeScript Globally Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Installs the TypeScript compiler globally using npm. Ensure you have Node.js and npm installed. ```bash sudo npm install tsc -g ``` -------------------------------- ### Get Help for TFX Extension Commands Source: https://github.com/microsoft/tfs-cli/blob/master/docs/extensions.md This command displays help information for a specific TFX extension sub-command, providing details on its usage, arguments, and options. ```bash tfx extension {command} --help ``` -------------------------------- ### Get help for a tfx-cli command Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Provides detailed help information for a specific tfx-cli command. ```bash tfx --help ``` -------------------------------- ### Manifest JS File Example Source: https://github.com/microsoft/tfs-cli/blob/master/docs/extensions.md An example of a Node.js CommonJS module for defining extension manifests. It exports a function that returns the manifest JSON object, allowing for environment-specific configurations. ```javascript module.exports = (env) => { let [idPostfix, namePostfix] = (env.mode == "development") ? ["-dev", " [DEV]"] : ["", ""]; let manifest = { manifestVersion: 1, id: `myextensionidentifier${idPostfix}`, name: `My Great Extension${namePostfix}`, ... contributions: [ { id: "mywidgetidentifier", properties: { name: `Super Widget${namePostfix}`, ... }, ... } ] } if (env.mode == 'development') { manifest.baseUri = "https://localhost:3000"; } return manifest; } ``` -------------------------------- ### Install Dev Dependencies Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Installs development dependencies for the TFS CLI project from the root directory. This is a prerequisite for building the project. ```bash npm install ``` -------------------------------- ### Link CLI for Global Testing Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Globally link the TFS CLI package to test it as if it were installed globally. This allows you to run `tfx` commands directly from your terminal. ```bash npm link ``` ```bash tfx ``` -------------------------------- ### Unlink CLI Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Remove the global link created by `npm link` when you are finished testing. This reverts the global installation to its previous state. ```bash npm unlink -g tfx-cli ``` -------------------------------- ### Queue a Build Source: https://github.com/microsoft/tfs-cli/blob/master/docs/builds.md Queues a build for a given project using either the definition ID or name. Ensure the project and definition are correctly specified. ```bash ~$ tfx build queue --project MyProject --definition-name TestDefinition Copyright Microsoft Corporation Queued new build: id : 1 definition name : TestDefinition requested by : Teddy Ward status : NotStarted queue time : Fri Aug 21 2015 15:07:49 GMT-0400 (Eastern Daylight Time) ``` -------------------------------- ### List Build Tasks on Server Source: https://github.com/microsoft/tfs-cli/blob/master/docs/buildtasks.md Lists all build tasks currently available on the server. The output includes the task ID, name, friendly name, visibility, description, and version. ```bash ~$ tfx build tasks list ... id : 4e131b60-5532-4362-95b6-7c67d9841b4f name : OctopusCreateRelease friendly name : Create Octopus Release visibility: Build,Release description: Create a Release in Octopus Deploy version: 0.1.2 ``` -------------------------------- ### Publish Extension with Sharing Source: https://github.com/microsoft/tfs-cli/blob/master/docs/extensions.md Command to publish an extension to the Marketplace. It supports options from `extension create` and allows sharing the extension with specific accounts. ```bash tfx extension publish --publisher mypublisher --manifest-js myextension.config.js --env mode=development --share-with myaccount ``` -------------------------------- ### Run All Server Integration Tests Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Execute all server integration tests. This command also automatically builds the integrated mock server. ```bash npm run test:server-integration ``` -------------------------------- ### Run Basic Extension Command Tests Source: https://github.com/microsoft/tfs-cli/blob/master/tests/extension-samples/README.md Execute tests for basic extension commands, including help text and core functionality. ```bash npm run test:extension-commands # Basic command tests ``` -------------------------------- ### Show Build Information Source: https://github.com/microsoft/tfs-cli/blob/master/docs/builds.md Displays detailed information for a specific build by its ID within a given project. This is useful for checking the status and details of a particular build. ```bash $ tfx build show --project MyProject --id 1 Copyright Microsoft Corporation id : 1 definition name : TestDefinition requested by : Teddy Ward status : NotStarted queue time : Fri Aug 21 2015 15:07:49 GMT-0400 (Eastern Daylight Time) ``` -------------------------------- ### Create a New Build Task Source: https://github.com/microsoft/tfs-cli/blob/master/docs/buildtasks.md Use this command to create a new, templated build task. You will be prompted to enter details like short name, friendly name, description, and author. A temporary task icon and basic files will be generated. ```bash ~$ tfx build tasks create Copyright Microsoft Corporation Enter short name > sample Enter friendly name > Sample Task Enter description > Sample Task for Docs Enter author > Me created task @ /Users/bryanmac/sample id : 305898e0-3eba-11e5-af7a-1181c3c6c966 name: sample A temporary task icon was created. Replace with a 32x32 png with transparencies ~$ ls ./sample icon.png sample.js sample.ps1 task.json ``` -------------------------------- ### List builds with saved settings Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Lists builds for a project, saving the specified options to the settings cache for future use. ```bash ~$ tfx build list --project MyProject --definition-name println --top 5 --save ... id : 1 definition name : TestDefinition requested by : Teddy Ward status : NotStarted queue time : Fri Aug 21 2015 15:07:49 GMT-0400 (Eastern Daylight Time) ``` -------------------------------- ### Login to Team Foundation Server Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Use this command to log in to a Team Foundation Server instance. Ensure you use the collection URL for the --service-url. ```bash tfx login --service-url http://myServer/DefaultCollection ``` -------------------------------- ### List builds using saved settings Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Lists builds using previously saved settings from the settings cache. ```bash ~$ tfx build list Copyright Microsoft Corporation ... id : 1 definition name : TestDefinition requested by : Teddy Ward status : NotStarted queue time : Fri Aug 21 2015 15:07:49 GMT-0400 (Eastern Daylight Time) ``` -------------------------------- ### View available tfx-cli commands Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Displays a list of all available commands for the tfx-cli. ```bash tfx ``` -------------------------------- ### Enable TFX Tracing for Debugging Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Demonstrates how to enable TFX tracing by setting the `TFX_TRACE` environment variable. This is often used in conjunction with mock server verbose logging for comprehensive debugging. ```bash # Example debugging session set TFX_TRACE=1 npm run test:server-integration-login ``` -------------------------------- ### Run Individual Server Integration Test Suites Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Execute specific server integration test suites for different command categories. The mock server is automatically managed. ```bash npm run test:server-integration-build npm run test:server-integration-workitem npm run test:server-integration-extension npm run test:server-integration-login npm run test:server-integration-buildtasks ``` -------------------------------- ### Combine TFX Tracing and Mock Server Verbose Logging Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Shows how to combine TFX tracing and mock server verbose logging for complete debugging by setting the `TFX_TRACE` environment variable and running the test suite. ```bash set TFX_TRACE=1 npm run test:server-integration-login ``` -------------------------------- ### List Builds Source: https://github.com/microsoft/tfs-cli/blob/master/docs/builds.md Queries and lists builds for a project, with options to filter by definition ID, definition name, status, or to limit the number of results. This command helps in reviewing build history. ```bash ~$ tfx build list Copyright Microsoft Corporation ... id : 1 definition name : TestDefinition requested by : Teddy Ward status : NotStarted queue time : Fri Aug 21 2015 15:07:49 GMT-0400 (Eastern Daylight Time) ``` -------------------------------- ### Run All Extension Tests Source: https://github.com/microsoft/tfs-cli/blob/master/tests/extension-samples/README.md Execute all extension tests as part of the full test suite. ```bash npm test ``` -------------------------------- ### Build the TFS CLI Project Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Builds the TFS CLI product using npm. The output is placed in the _build/app directory. ```bash npm run build ``` -------------------------------- ### Upload a Build Task Source: https://github.com/microsoft/tfs-cli/blob/master/docs/buildtasks.md Uploads a build task to the server. Specify the path to the directory containing the task files. Ensure the task version is bumped if implementation changes. ```bash ~$ git clone https://github.com/OctopusDeploy/OctoTFS Cloning into 'OctoTFS'... Checking connectivity... done. ~$ cd OctoTFS/source/CustomBuildSteps ``` ```bash ~$ tfx build tasks upload --task-path ./CreateOctopusRelease ``` -------------------------------- ### Create Work Item with JSON Values (CMD) Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Creates a new work item, specifying multiple fields including title and description using a JSON object passed via CMD. ```bash tfx workitem create --work-item-type Bug --project MyProject --values {"system.title":"MyTitle", "system.description":"MyDescription"} ``` -------------------------------- ### Login to Visual Studio Team Services Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Use this command to log in to Visual Studio Team Services. Your normal account URL will work for the --service-url. ```bash tfx login --service-url https://myAccount.VisualStudio.com ``` -------------------------------- ### Run Tests with CI Reporter Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Runs all tests using a CI-compatible reporter for consistent output in continuous integration environments. ```bash npm run test:ci ``` -------------------------------- ### Enable Mock Server Verbose Logging Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md Shows how to enable verbose logging for the mock DevOps server by adding `verbose: true` to the `createMockServer` options. This is useful for debugging HTTP requests and server activity. ```typescript // Before mockServer = await createMockServer({ port: 8084 }); // After (for debugging) mockServer = await createMockServer({ port: 8084, verbose: true }); ``` -------------------------------- ### Create Work Item with Title Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Creates a new work item of a specified type and project, setting only the title. ```bash tfx workitem create --work-item-type Bug --project MyProject --title MyTitle ``` -------------------------------- ### Enable Mock Server Verbose Logging on Windows Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_MOCKSERVER_OUTPUT environment variable to enable verbose logging for the integrated mock server during tests on Windows Command Prompt. ```bash set DEBUG_MOCKSERVER_OUTPUT=true ``` -------------------------------- ### Log in to TFS with Basic Authentication Source: https://github.com/microsoft/tfs-cli/blob/master/docs/configureBasicAuth.md Use this command to log in to your TFS server using basic authentication. You will be prompted for your service URL, username, and password. ```bash > tfx login --auth-type basic Copyright Microsoft Corporation Enter service url > http://localhost:8080/tfs/defaultcollection Enter username > fabfiber\peter Enter password > ******* logged in successfully ``` -------------------------------- ### Run Specific Test Suites Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Execute individual test suites for targeted testing. Use these commands to focus on specific areas of the project. ```bash npm run test:build-commands ``` ```bash npm run test:extension-commands ``` ```bash npm run test:commandline ``` ```bash npm run test:server-integration ``` -------------------------------- ### Run Complex Extension Scenario Tests Source: https://github.com/microsoft/tfs-cli/blob/master/tests/extension-samples/README.md Execute tests for complex extension scenarios, including edge cases and file system handling. ```bash npm run test:extension-complex # Complex scenario tests ``` -------------------------------- ### Package Extension for a Different Publisher Source: https://github.com/microsoft/tfs-cli/blob/master/docs/extensions.md Use this command to package an extension, specifying a different publisher ID than what's in the manifest. It also allows passing environment variables to a manifest JS file. ```bash tfx extension create --publisher mypublisher --manifest-js myextension.config.js --env mode=production ``` -------------------------------- ### Run Specific Test with Verbose Logging Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Execute a specific test file after enabling verbose logging in the mock server configuration. ```bash npm run test:server-integration-login ``` -------------------------------- ### Enable Mock Server Verbose Logging on Linux/OSX Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_MOCKSERVER_OUTPUT environment variable to enable verbose logging for the integrated mock server during tests on Linux or macOS. ```bash export DEBUG_MOCKSERVER_OUTPUT=true ``` -------------------------------- ### Query Work Items Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Searches for work items using a Work Item Query Language (WIQL) query. Optionally specify a project to enable macros like @Project. ```bash tfx workitem query --project MyProject --query "select [system.id], [system.title] from WorkItems" ``` -------------------------------- ### Execute Command and Assert Behavior Source: https://github.com/microsoft/tfs-cli/blob/master/tests/README-server-integration.md This snippet demonstrates how to execute a tfs-cli command within a test, capture its output, and assert expected behavior or handle connection/authentication errors. It uses `execAsync` for asynchronous command execution. ```typescript it('should test command behavior', function(done) { const command = `node "${tfxPath}" command --service-url "${serverUrl}" --auth-type basic --username testuser --password testpass --no-prompt`; execAsync(command) .then(({ stdout }) => { // Assert expected behavior assert(condition, 'Description'); done(); }) .catch((error) => { // Handle expected connection/auth errors const errorOutput = stripColors(error.stderr || error.stdout || ''); if (errorOutput.includes('Could not connect') || errorOutput.includes('unable to connect')) { done(); // Expected connection attempt } else { done(error); } }); }); ``` -------------------------------- ### Execute CLI with Node.js Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Run the built TFS CLI executable directly using Node.js. Useful for testing changes locally after building. ```bash node _build/tfx-cli.js ``` ```bash node _build/tfx-cli.js --help ``` -------------------------------- ### Clean Build Artifacts Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Optional command to remove generated build files. ```bash npm run clean ``` -------------------------------- ### Run Advanced Extension Feature Tests Source: https://github.com/microsoft/tfs-cli/blob/master/tests/extension-samples/README.md Execute tests for advanced extension features such as manifest overrides and global arguments. ```bash npm run test:extension-advanced # Advanced feature tests ``` -------------------------------- ### Login using Personal Access Token Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Logs into Azure DevOps Services or TFS using a Personal Access Token. Prompts for service URL and token. ```bash ~$ tfx login Copyright Microsoft Corporation > Service URL: {url} > Personal access token: xxxxxxxxxxxx Logged in successfully ``` -------------------------------- ### Show Work Item Details Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Retrieves and displays the details of a specific work item. You must provide the work item's ID. ```bash tfx workitem show --work-item-id 2 ``` -------------------------------- ### Create Work Item with JSON Values (PowerShell) Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Creates a new work item, specifying multiple fields including title and description using a JSON object passed via PowerShell. ```bash tfx workitem create --work-item-type Bug --project MyProject --values --% {"system.title":"MyTitle", "system.description":"MyDescription"} ``` -------------------------------- ### Enable CLI Trace Output on Windows Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the TFX_TRACE environment variable to enable detailed tracing output from the CLI on Windows Command Prompt. ```bash set TFX_TRACE=1 ``` -------------------------------- ### Enable Mock Server Verbose Logging Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Temporarily modify test files to enable verbose logging for the mock server. This helps in debugging server integration tests by showing detailed request/response information. ```typescript // Current call mockServer = await createMockServer({ port: 8084 }); // Add verbose option mockServer = await createMockServer({ port: 8084, verbose: true }); ``` -------------------------------- ### Enable Mock Server Verbose Logging on PowerShell Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_MOCKSERVER_OUTPUT environment variable to enable verbose logging for the integrated mock server during tests on PowerShell. ```powershell $env:DEBUG_MOCKSERVER_OUTPUT='true' ``` -------------------------------- ### Enable CLI Trace Output on PowerShell Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the TFX_TRACE environment variable to enable detailed tracing output from the CLI on PowerShell. ```powershell $env:TFX_TRACE=1 ``` -------------------------------- ### Update Work Item with JSON Values (CMD) Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Updates an existing work item, setting multiple fields using a JSON object passed via CMD. Requires the work item ID. ```bash tfx workitem update --work-item-id 11 --values {"system.title":"MyTitle", "system.description":"MyDescription"} ``` -------------------------------- ### Enable Tracing in TFS CLI Source: https://github.com/microsoft/tfs-cli/blob/master/docs/contributions.md Enables detailed tracing output for the TFS CLI by setting the TFX_TRACE environment variable. This is useful for debugging and understanding tool behavior. ```bash export TFX_TRACE=1 ``` -------------------------------- ### Enable Debug Output for Tests on Windows Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_CLI_OUTPUT environment variable to enable detailed debug output for CLI commands during tests on Windows Command Prompt. ```bash set DEBUG_CLI_OUTPUT=true ``` -------------------------------- ### Enable Debug Output for Tests on Linux/OSX Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_CLI_OUTPUT environment variable to enable detailed debug output for CLI commands during tests on Linux or macOS. ```bash export DEBUG_CLI_OUTPUT=true ``` -------------------------------- ### Increment Extension Version Source: https://github.com/microsoft/tfs-cli/blob/master/docs/extensions.md This command automatically increments the patch segment of the extension's version number. The updated version is reflected in the packaged VSIX and the source manifest file. ```bash tfx extension create --rev-version ``` -------------------------------- ### Enable Debug Output for Tests on PowerShell Source: https://github.com/microsoft/tfs-cli/blob/master/README.md Sets the DEBUG_CLI_OUTPUT environment variable to enable detailed debug output for CLI commands during tests on PowerShell. ```powershell $env:DEBUG_CLI_OUTPUT='true' ``` -------------------------------- ### Update Work Item with JSON Values (PowerShell) Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Updates an existing work item, setting multiple fields using a JSON object passed via PowerShell. Requires the work item ID. ```bash tfx workitem update --work-item-id 11 --values --% {"system.title":"MyTitle", "system.description":"MyDescription"} ``` -------------------------------- ### Delete a Build Task Source: https://github.com/microsoft/tfs-cli/blob/master/docs/buildtasks.md Deletes a build task from the server using its unique ID. Exercise caution when deleting tasks. ```bash ~/$ tfx build tasks delete --task-id 4e131b60-5532-4362-95b6-7c67d9841b4f Copyright Microsoft Corporation task: 4e131b60-5532-4362-95b6-7c67d9841b4f deleted successfully! ``` -------------------------------- ### Update Work Item Title Source: https://github.com/microsoft/tfs-cli/blob/master/docs/workitems.md Updates the title of an existing work item. You must provide the work item's ID and the new title. ```bash tfx workitem update --work-item-id 11 --title MyTitle ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.