You can do this with DIGITS, but you will have to set up the line to be shared with other devices first if you haven't already.
You'll want to make sure you know your security questions as you will need to complete 2FA before utilizing the web client to access your messages and calls. If you are looking to use the service and your phone is not going to be handy (say, for a one time PIN to be sent out), you'll need to make sure you know the answers to your security questions because you will have to answer them every time you log in. You can check this by logging in to T-Mobile.com>Profile>T-Mobile ID>Security Questions.
To Enable DIGITS for your line:
1.) Log In To T-Mobile.com.
2.) Then click "Profile" in the upper right hand corner.
3.) Scroll down to "Multiple Devices" and click.
4.) Choose the line you are wishing to see from the drop down box, then ensure that the "Device Status" is turned ON.
5.) Click the "Manage Settings" under DIGITS to open the DIGITS Web Portal.
6.) From the portal, check if the number you wish to view is listed under "DIGITS I Can Use," if so, you're done and can log in to the Web Client to send and receive calls and texts from your computer or other device.
7.) If you don't see it under "DIGITS I Can Use", you'll need to click on the desired number under "Other DIGITS I Can Manage"
8.) Click "Add Myself" to add your T-Mobile ID as a user to the line of service. This way, when you log into the DIGITS Client with your T-Mobile ID, the number will appear as one you can use.
You're now good to go! You'll only have to complete the above steps once to ensure the number can be shared with other device(s).
10.) Turn on the switch next to the number you wish to use and click "Register".