fstnetwork
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    [Back to LOC CLI Guidebook](https://hackmd.io/4LIsNIuWQnuR70JMeuBAEA?view) [Getting Started - JavaScript](https://hackmd.io/IiHvmAtjTTGFfakaH0dWuw?view) [Getting Started - TypeScript](https://hackmd.io/kz93Th7vTCCbO3GFxp3r-A) [LOC CLI Commands](https://hackmd.io/R4mrz2t1QSyTCHH73_2itg) [Local Simple Runtime Execution](https://hackmd.io/JhAMB49rS4CrpNdhHed7YA) # Setup LOC CLI Environment ## Download LOC CLI Firstly, download **LOC CLI Executable Binary** with respect to your platform. :::info Please contact your window to download LOC CLI Executable Binary; you can also contact us for these files at support@fstk.io or (886) 223-213-806. ::: Installation guide: - [Windows](###Windows) - [macOS](###macOS-x64) - [Linux](###Linux-x64) ### Windows (x64) 1. Download **loc-windows.exe**. 2. Rename **loc-windows.exe** as **loc.exe**, for convenience purpose. 3. *(optional, for non-Windows 11 users)* Install [Windows Terminal](https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701). 4. Open Command Prompt, PowerShell or Windows Terminal, and make a directory where you are going to put *loc.exe* (for example, ```C:\FST```), by using the command `mkdir [directory name]`: ```bash cd \ mkdir FST cd FST ``` 5. Add ```C:\FST``` to the $PATH environment variable. ([Windows instruction](https://docs.microsoft.com/en-us/previous-versions/office/developer/sharepoint-2010/ee537574(v=office.14))) 6. ==Re-open== a new console and test **loc.exe**: (Command Prompt or Windows Terminal) ```bash loc ``` (PowerShell) ```bash ./loc ``` If successful, you can expect to see the following outputs: ``` Usage: loc [options] [command] Options: -V, --version output the version number -h, --help display help for command Commands: new [options] <name> create data process template including sample generic logics, aggregator logic and data process config files deploy [options] <name> deploy data process template including logics and dataprocess config files login [options] login logic|l dataprocess|dp apiroute|ar profile help [command] display help for command ``` :::info You can use ```loc [command] -h``` to find out more commands. See ++[**LOC CLI Commands**](https://hackmd.io/R4mrz2t1QSyTCHH73_2itg)++ for details. If you have added LOC CLI to your ```$PATH```, you can execute it in Command Prompt or PowerShell from any other location with ```loc```. ::: 6. *(recommended but optional)* [Install VS Code](https://code.visualstudio.com/download) ([Windows instruction](https://code.visualstudio.com/docs/setup/windows)). In VS Code, install the **JavaScript and TypeScript Nightly** extension ([instruction](https://code.visualstudio.com/learn/get-started/extensions)). ![](https://hackmd.io/_uploads/ByEU7JzD5.png) :::info The default Windows terminal in VS Code is PowerShell. If you haven't added LOC CLI to ```$PATH```, switch to the ```/FST``` folder and use ```./loc```. ::: 7. *(optional for TypeScript developers)* Install [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/en/download/) (using Windows installer; for the Node.js installer, DO NOT tick ```Automically install the necessary tools``` checkbox). ### macOS (x64) 1. Download **loc-macos-x64**. 2. Create a new directory, for example, ```/home/<user>/FST```, and copy **loc-macos-x64** into it: (If your terminal starts at ```/home/<user>```) ```bash mkdir FST ``` 3. Rename **loc-macos-x64** to **loc**, for convenience purpose: ```bash mv loc-macos-x64 loc ``` 4. Add ```/home/<user>/FST``` to $PATH environment variable. (see: [macOS instruction](https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/).) 5. Open terminal and switch to ```/home/<user>/FST```: ```bash cd FST ``` 6. Add permission for **loc**: ```bash chmod a+x ./loc ``` 7. Test **loc** in terminal: ```bash ./loc ``` If successful, you can expect to see the following outputs: ``` Usage: loc [options] [command] Options: -V, --version output the version number -h, --help display help for command Commands: new [options] <name> create data process template including sample generic logics, aggregator logic and data process config files deploy [options] <name> deploy data process template including logics and dataprocess config files login [options] login logic|l dataprocess|dp apiroute|ar profile help [command] display help for command ``` :::info You can use ```loc [command] -h``` to find out more commands. See ++[**LOC CLI Commands**](https://hackmd.io/R4mrz2t1QSyTCHH73_2itg)++ for details. If you have added LOC CLI to your ```$PATH```, you can execute it in the terminal from any other location with ```loc```. If not, switch to the ```/FST``` dir and use ```./loc```. ::: 8. *(recommended but optional)* [Install VS Code](https://code.visualstudio.com/download) ([macOS instruction](https://code.visualstudio.com/docs/setup/mac)). In VS Code, install the **JavaScript and TypeScript Nightly** extension ([instruction](https://code.visualstudio.com/learn/get-started/extensions)). 9. *(optional for TypeScript developers)* Install [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/en/download/) (using macOS installer) Or: ```bash brew update brew install git brew install node ``` ### Linux (x64) 1. Download **loc-linux-x64**. 2. Create a new directory, for example, ```/home/<user>/FST```, and copy **loc-linux-x64** into it: (If your terminal starts at ```/home/<user>```) ```bash mkdir FST ``` 3. Rename **loc-linux-x64** to **loc**, for convenience purpose: ```bash mv loc-linux-x64 loc ``` 4. Add ```/home/<user>/FST``` to $PATH environment variable: ```bash sudo nano ~/.bashrc ``` Add the following line at the end of the file ```bash export PATH="$PATH":"$HOME/FST" ``` Press ```Ctrl + X``` then ```Y``` to save. Next, make the new change to take effect: ```bash source ~/.bashrc ``` 5. Open terminal and switch to ```/home/<user>/FST```: ```bash cd FST ``` 6. Add permission for **loc**: ```bash chmod a+x loc ``` 7. Test **loc** in terminal: ```bash loc ``` If successful, you can expect to see the following outputs: ``` Usage: loc [options] [command] Options: -V, --version output the version number -h, --help display help for command Commands: new [options] <name> create data process template including sample generic logics, aggregator logic and data process config files deploy [options] <name> deploy data process template including logics and dataprocess config files login [options] login logic|l dataprocess|dp apiroute|ar profile help [command] display help for command ``` :::info You can use ```loc [command] -h``` to find out more commands. See ++[**LOC CLI Commands**](https://hackmd.io/R4mrz2t1QSyTCHH73_2itg)++ for details. If you have added LOC CLI to your ```$PATH```, you can execute it in the terminal from any other location with ```loc```. If not, switch to the ```/FST``` dir and use ```./loc```. ::: 8. *(recommended but optional)* [Install VS Code](https://code.visualstudio.com/download) ([Linux instruction](https://code.visualstudio.com/docs/setup/linux)). In VS Code, install the **JavaScript and TypeScript Nightly** extension ([instruction](https://code.visualstudio.com/learn/get-started/extensions)). 9. *(optional for TypeScript developers)* Install [Node.js](https://nodejs.org/en/download/): ```bash sudo apt install curl curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get update sudo apt install nodejs ``` Install [Git](https://git-scm.com/downloads): ```bash sudo apt install git ``` ## User Setup ### Profile LOC CLI requires a **profile** file, which contains the environment information of the deployment and will be provided by FST Network. A .yaml profile (for example, ```example.yaml```) looks like this: ```yaml baseURL: https://api.loc.xxxxx namespace: xxxxxxxx authURL: https://auth.xxxxx.xxxxxxx/auth realm: xxxxx clientId: xxxxx-xxxxx-xxxxx ``` :::info Please contact your window for your profile details to complete the setup; you can also contact us for these details at support@fstk.io or (886) 223-213-806. ::: 1. Copy the profile into your LOC CLI workspace directory. 2. Add the profile to LOC CLI: ```bash > loc profile set -f example.yaml -p example Done! ``` 3. Inspect the list of profiles: ```bash > loc profile list CURRENT NAME ------- ---------- * test example ``` :::info The added profile will be kept in your machine and can hence be accessed by LOC CLI. ::: 4. Set the profile you just added as defult: ```bash > loc profile default example Switched profile to 'example'. ``` ### Login Login to your LOC environment: ```bash > loc login ? Username: user.name@email.com ? Password: ******** Successfully Login! ``` :::info Login is required for accessing your LOC deployment environment. You will get a ```access token``` after login. LOC CLI will automatically log out the current user after 5 mins of inactivity. You can inspect your tokens (keys) with this command: ```bash loc profile get ``` ::: ## Create a Data Process Template Folder ### Create a ```JavaScript``` Template (Default) 1. Create a new data process template ```hello-world```: ```bash > loc new hello-world 🔍 Check Folder Name: hello-world... 🎉 Generating Data Process Template folder... 🔨 Building fresh packages... ✨ Successfully created Data Process Template in hello-world. ``` 2. A sub-directory named ```hello-world``` should be create under your workspace: ``` FST hello-world generic-logic 1.js 2.js aggregator-logic.js api-route-config config.yaml package.json ``` You can create other new data process templates in the future in this way `./loc new [template name]`. :::info See ++[**Getting Started - Hello World (JavaScript)**](https://hackmd.io/IiHvmAtjTTGFfakaH0dWuw)++ for how to develop and deploy your first data process. ::: ### Create a ```TypeScript``` Template 1. LOC supports TypeScript in developing data processes as well. Create a new TypeScript template ```hello-world```: ```bash > loc new hello-world -ts 🔍 Check Folder Name: hello-world... 🎉 Generating Data Process Template folder... 🔨 Building fresh packages... ✨ Successfully created Data Process Template in hello-world. ``` 2. A sub-directory named ```hello-world``` should be create under your workspace: ``` FST hello-world generic-logic 1.ts 2.ts aggregator-logic.ts api-route-config config.yaml package.json tsconfig.json ``` :::info See ++[**Getting Started - Hello World (TypeScript)**](https://hackmd.io/kz93Th7vTCCbO3GFxp3r-A)++ for how to develop and deploy your first data process. ::: --- <text style="font-size:17pt">**LOC CLI Guidebook Catalogue**</text> <text style="font-size:13pt"> [LOC CLI Introduction](https://hackmd.io/J5r2l2OaRgKF9LACR5KHsg?view)</text> <text style="font-size:13pt"> [LOC Concept](https://hackmd.io/mwTxDdBjSuiKrAmainQZAA?view)</text> <text style="font-size:13pt"> [LOC CLI Commands](https://hackmd.io/R4mrz2t1QSyTCHH73_2itg?view)</text> <text style="font-size:13pt"> [Getting Started - JavaScript](https://hackmd.io/IiHvmAtjTTGFfakaH0dWuw?view)</text> <text style="font-size:13pt"> [Getting Started - TypeScript](https://hackmd.io/kz93Th7vTCCbO3GFxp3r-A?view)</text> <text style="font-size:13pt"> [Reference - Agent List](https://hackmd.io/Uj-tC7l9Q82VyGr8R5PL2Q?view)</text> <text style="font-size:13pt"> [Reference - Event Fields Comparison Table](https://hackmd.io/N2Km6-8kRI2tMR5X4tRHeQ?view)</text> ###### tags: `LOC CLI`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully