How to get tf.exe (TFS command line client)?
Asked Answered
N

10

105

What's the minimum amount of software I need to install to get the 'tf.exe' program?

Northrop answered 31/3, 2011 at 17:30 Comment(0)
T
95

You need to install Team Explorer, it's best to install the version of Team Explorer that matches the version of TFS you are using e.g. if you're using TFS 2010 then install Team Explorer 2010.

2012 version http://www.microsoft.com/en-gb/download/details.aspx?id=30656

2013 version http://www.microsoft.com/en-us/download/details.aspx?id=40776

2019 version https://visualstudio.microsoft.com/downloads/#visual-studio-team-explorer-2019

You also might be interested in the TFS power tools. They add some extra command line features (using tfpt.exe) and also add some extra IDE features.

Truesdale answered 31/3, 2011 at 22:53 Comment(12)
If it is installed by visual studio, it should be in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE" or "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE"Stoeber
+1 Michael -- Then, natch, if TF.exe not on your PATH, right-click Computer in Windows Explorer, chose Properties, Advanced System Settings, Environment Variables, System Variables, Path, Edit, add a ; and then C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE to the end of the current string in Variable Value. Then Windows-R, cmd, enter, tf. Voila. QED. Profit. You had TF the whole time.Attributive
I have Team Explorer 2010 and power tools installed, but my Explorer (right-click) extension isn't working in Server 2012.Rosenberger
FYI, for TFS 2013, looks like you need Team Explorer Everywhere 2013, which is Java-based. Adding it here because I just needed it.Schock
I have TFS server 2013 and I used tf the one comming with Visual Stutio 2015, so this working pretty well for me.Helles
Note that later versions have a better answer for getting this tool, from the vsts agent installation, no team explorer required at that point. I'm on TFS 2017 and found it under externals/vstshost, with all the associated dllsBoyd
Late to the game, but you can also search for tf.exe on the command line. where /R C:\ *tf.exe Just replace the directory with your directory of choice.Realize
2012/2013 Links don't work anymore. Added 2019 version.Ab
Another installation alternative is chocolaty. for vs2017: "choco install visualstudio2017teamexplorer". this doesn't solve the installation size, see @Bert-Van-Landeghem below.Elis
For VS 2019, I found mine at C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer. I did a bullheaded search with dir tf.exe /S to find it, fwiw. Don't forget to add the dir to your PATH if it wasn't there alreadyAttributive
Tip the executable might be TF.exe (uppercase). Incase you happen to be like me using a case sensitive search tool and wondering why your not getting any results. (i.e. WSL and find)Monopolist
And for studio 2022: C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exeUnexpressive
G
61

I'm in a virtual machine, and am trying to keep my VHD as small as possible, so I find Team Explorer is a really heavyweight solution (300+ MB install). As an alternative, I've had some luck copying a minimal set of EXEs/DLLs from a Team Explorer installation to a clean machine (.NET 4.0 is still required, of course).

I've only tried a handful of operations so far, but this set of files (about 8.5 MB) has been enough to get basic source-control functionality via tf.exe:

  • TF.exe
  • TF.exe.config
  • Microsoft.TeamFoundation.dll
  • Microsoft.TeamFoundation.Client.dll
  • Microsoft.TeamFoundation.Common.dll
  • Microsoft.TeamFoundation.Common.Library.dll
  • Microsoft.TeamFoundation.VersionControl.Client.dll
  • Microsoft.TeamFoundation.VersionControl.Common.dll
  • Microsoft.TeamFoundation.VersionControl.Controls.dll

(It should go without saying that this is a completely unsupported solution, and it doesn't free you from the normal TFS licensing requirements.)

Depending on the operations you perform, you may find that additional DLLs are required. Fortunately, tf.exe will produce a nice error message telling you exactly which ones are missing.

Gutty answered 23/9, 2011 at 22:25 Comment(2)
that's a thing of beauty. I did need Microsoft.TeamFoundation.Build.Controls.dll to check in.Schock
I found tf.exe and its .config in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE, VersionControl.Controls.dll in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies and the DLLs in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0.Turanian
M
53

For Visual Studio 2017 & 2019, it can be found here :

-Replace {YEAR} by the appropriate year ("2017", "2019").

-Replace {EDITION} by the appropriate edition name ("Enterprise", "Professional", or "Community")

C:\Program Files (x86)\Microsoft Visual Studio\{YEAR}\{EDITION}\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe

For Visual Studio 2022, it can be found here :

C:\Program Files\Microsoft Visual Studio\2022\{EDITION}\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe
Medick answered 2/3, 2018 at 0:5 Comment(1)
Whether it can be used for AzureDevOps?Diphenylamine
A
11

There is a Java TFS client in the Team Explorer Everywhere installation (together with an Eclipse plugin). Look at http://www.microsoft.com/en-us/download/details.aspx?id=30661

Astolat answered 31/1, 2013 at 9:51 Comment(0)
K
9

For reference: these are the required DLLs for Visual Studio 2017 (as did @ijprest for the VS 2010)

TF.exe
TF.exe.config
Microsoft.TeamFoundation.Client.dll
Microsoft.TeamFoundation.Common.dll
Microsoft.TeamFoundation.Core.WebApi.dll
Microsoft.TeamFoundation.VersionControl.Client.dll
Microsoft.TeamFoundation.VersionControl.Common.dll
Microsoft.TeamFoundation.VersionControl.Controls.dll
Microsoft.VisualStudio.Services.Client.Interactive.dll
Microsoft.VisualStudio.Services.Common.dll
Microsoft.VisualStudio.Services.WebApi.dll

They will be in my base VM image. I'm going to use it to pull the latest deployment scripts from VC to a temporary local workspace folder when installing a new server.

tf workspace /new ... 
tf workfold /map ...
tf get "%WorkSpaceLocalFolder%" /recursive
tf workfold /unmap 
tf workspace /delete

<run deployment scripts from "%WorkSpaceLocalFolder%" >

rmdir "%WorkSpaceLocalFolder%"

(Sorry to post this as an answer, but I don't have enough reputation to comment, which I believe it should have been)

Kent answered 26/10, 2018 at 9:59 Comment(1)
This also works for VS2019. Also need to add Microsoft.TeamFoundation.Diff.dllFreddyfredek
E
6

The tf.exe command line is included in the VSTS agent package in folder externals\vstsom.

Engels answered 22/6, 2017 at 5:47 Comment(0)
S
4

You can also try TFS CLI for Node.js which is a cross-platform CLI for Microsoft Team Foundation Server and Visual Studio Team Services.

Shaunshauna answered 12/6, 2017 at 18:25 Comment(0)
B
4

Visual Studio 2017 Team Explorer

According to https://blogs.msdn.microsoft.com/bharry/2017/04/05/team-explorer-for-tfs-2017/ you can now download it separately from Visual Studio via this link:

https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=TeamExplorer&rel=15

Bultman answered 20/7, 2018 at 12:7 Comment(0)
D
1

Update for Version 2022:

Navigate to:

C:\Program Files\Microsoft Visual Studio\2022\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

Create a Workspace

tf workspace -new WORKSPACE_NAME -collection:https://YOUR_ACCOUNT.visualstudio.com/DefaultCollection/

Then grab your files

tf get /recursive
Disregard answered 19/4, 2023 at 18:54 Comment(0)
K
0

Following on from the earlier answers above but based on a VS 2019 install ;
I needed to run "tf git permission" commands, and copied the following files from:

C:\Program Files (x86)\Microsoft Visual Studio\2019\TeamExplorer\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer

Microsoft.TeamFoundation.Client.dll
Microsoft.TeamFoundation.Common.dll
Microsoft.TeamFoundation.Core.WebApi.dll
Microsoft.TeamFoundation.Diff.dll
Microsoft.TeamFoundation.Git.Client.dll
Microsoft.TeamFoundation.Git.Contracts.dll
Microsoft.TeamFoundation.Git.Controls.dll
Microsoft.TeamFoundation.Git.CoreServices.dll
Microsoft.TeamFoundation.Git.dll
Microsoft.TeamFoundation.Git.Graph.dll
Microsoft.TeamFoundation.Git.HostingProvider.AzureDevOps.dll
Microsoft.TeamFoundation.Git.HostingProvider.GitHub.dll
Microsoft.TeamFoundation.Git.HostingProvider.GitHub.imagemanifest
Microsoft.TeamFoundation.Git.Provider.dll
Microsoft.TeamFoundation.SourceControl.WebApi.dll
Microsoft.TeamFoundation.VersionControl.Client.dll
Microsoft.TeamFoundation.VersionControl.Common.dll
Microsoft.TeamFoundation.VersionControl.Common.Integration.dll
Microsoft.TeamFoundation.VersionControl.Controls.dll
Microsoft.VisualStudio.Services.Client.Interactive.dll
Microsoft.VisualStudio.Services.Common.dll
Microsoft.VisualStudio.Services.WebApi.dll
TF.exe
TF.exe.config
Kelda answered 23/1, 2021 at 17:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.