Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

By Your Command! Meet the Command Line Interface

Today is another exciting landmark in the evolution of the Fitbit OS Software Development Kit (SDK). We’re proud to announce a major enhancement: an entirely new way to build apps and clock faces for Fitbit OS. We have created a command-line interface that is compatible with macOS, Windows, and Linux, and allows developers to build and install Fitbit OS projects while using their favorite code editors, and their preferred version control system. This update takes Fitbit OS app development beyond Fitbit Studio for the very first time.

 

https://dev.fitbit.com/blog/2018-08-23-cli-tools/

 

Best Answer
26 REPLIES 26

Finally! Congratulations! Now it's the real SDK.

Best Answer
0 Votes

Hi Jon, 

Eager to get this running, but I can't get past the login step. The video shows the user already logged in, but the video says a browser will pop up with login. My browser does not launch so I can't log in and run the app on the sim.

 

sfo-m-vg0qvh:~$ npx fitbit

npx: installed 3 in 2.362s

command not found: fitbit

 

If I create a new project everything works perfectly as described. This only happened on a project that I downloaded from Studio. 

Best Answer
0 Votes

Existing projects need the dependencies added. Check the CLI guide.

Best Answer
0 Votes

Found the isssue: 

npm add --dev @Fitbit/sdk-cli

 

Missed the second step. Assumed the section on updating existing projects was all I needed to know. I got the sdk installed but not the cli. 

 

Thanks! This is awesome !

 

Best Answer
0 Votes

Hi,

 

Does anyone know why I am getting:

 

Fetch of https://api.fitbit.com/1/user/-/developer-relay/hosts/undefined returned status 404 Not Found

 

When I issue "$fitbit install"

I built and connected the Ionic.

 

Thanks!

Itamar

 

Best Answer
0 Votes

Re the prerequsites, git also seems to be mandatory.

npx create-fitbit-app

...doesn't work for me without it.

If this is the case, could I suggest that the documentation be updated?

Peter McLennan
Gondwana Software
Best Answer

@ihassin please run the following command from your project folder, and paste the output.

 

FITBIT_QA_COMMANDS=1 npx fitbit 
hosts
Best Answer

@Gondwana sorry about that, it seems it was added as a last minute dependency due to an known issue with one of the other dependencies (source-map). We'll drop that requirement once they publish their fix.

Best Answer

Can I make a request for a command that builds and loads the app in one step?

> npx fitbit-run

 

 

Best Answer

@JonFitbitThanks for the info re git.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@JonFitbit wrote:

@ihassin please run the following command from your project folder, and paste the output.

 

FITBIT_QA_COMMANDS=1 npx fitbit 
hosts


Screen Shot 2018-08-24 at 9.05.36 PM.png

Best Answer
0 Votes

@JasonShort wrote:

Can I make a request for a command that builds and loads the app in one step?

> npx fitbit-run

 

 


Hey Jason,

I too don't want to have the REPL dialog within fitbit$... Until Fitbit fixes this, I came up with an expect script:

 

#!/usr/bin/expect -f

#set timeout -1

spawn ./fitbit-cli.sh

expect "fitbit"

send -- "install\n"
expect "fitbit"

send -- "exit\r"

expect eof

fitbit-cli.sh:

 

#!/usr/bin/env bash
npx fitbit-build
npx fitbit

 Check out in the demo app.

Best Answer

Initial experience with the CLI and Visual Studio Code is great, but why oh why no real time debugging/breakpoint support? Can you work on this next please!

 

Also, do I have to use GitHub, or can I use Git with Visual Studio Online?

Best Answer

> Also, do I have to use GitHub, or can I use Git with Visual Studio Online?

 

You can use any version control system and git hosting service you like. It has nothing to do with CLI tools.

 
 
 
Best Answer
0 Votes

@ihassin Fix is coming this week! Short term workaround: disconnect all devices but one

Best Answer

@JonFitbit wrote:

@ihassin please run the following command from your project folder, and paste the output.

 

FITBIT_QA_COMMANDS=1 npx fitbit 
hosts

I tried doing this to see if I could get any clues about why my runtime output was in terms of build files/lines rather than source-mapped. Unfortunately, I couldn't find FITBIT_QA_COMMANDS anywhere. Is this a linux-specific thing?

Peter McLennan
Gondwana Software
Best Answer
0 Votes


I tried doing this to see if I could get any clues about why my runtime output was in terms of build files/lines rather than source-mapped. Unfortunately, I couldn't find FITBIT_QA_COMMANDS anywhere. Is this a linux-specific thing?

It's not linux specific.

 

We're aware of some issues with source-mapping line numbers, hopefully it should be fixed in a upcoming update.

Best Answer

We're aware of some issues with source-mapping line numbers, hopefully it should be fixed in a upcoming update.

Thanks Jon; that would make be very happy!

 

I'm mystified about why I can't find FITBIT_QA_COMMANDS; makes me wonder whether there's something wrong with my installation.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

FWIW, sussed it on Windows:

set FITBIT_QA_COMMANDS=1
npx fitbit

 

Peter McLennan
Gondwana Software
Best Answer
0 Votes