Code Monkey home page Code Monkey logo

deta-cli's Introduction

deta

this is deta

deta-cli's People

Contributors

aavshr avatar abdelhai avatar donaldp avatar rabingaire avatar rohanshiva avatar xeust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deta-cli's Issues

Add command "deta deploy --force"

Add a command that will ignore .deta/state and load all files, while writing new hashes to .deta/state. For example deta deploy -f/--force.

Feature Request: clone/get `.deta` folder only

People who use git to store/backup/track their codebase can have some additional files for development. But they aren't pushed to deta micro using .detaignore. In this case, I clone the project from deta, clone the main codebase from git services and then copy the .deta folder to my git cloned codebase. It would be nicer if I could just get the .deta folder to identify the project to deta.

Proxy support

Add proxy support with authentication in deta-cli

ci: Multi-arch automated builds for CLi through GH Actions

About this Issue

When releasing a new version using GitHub Actions, it should be either only triggered on workflow_dispatch (using values from github.event.input.version and an special flag for pre-releases via github.event.input.isPrerelease) or releases:published (pull latest version from GitHub API). Then, Goreleaser will build for different CPU architectures on either in Docker container (with setting up QEMU and Buildx) or in these GitHub-hosted runners.

What CPU architectures should be supported next?

Probably ARM32 and ARM64 CPUs. For other architectures, maybe we should document the build process.

Related Issues

May fix in PR #40.

Use XDG Base Directory for storing config

Summary

Suggestion to put deta's config at XDG base dir

Proposed Changes

XDG Base Directory is a specification that defines where files should go. In this specification, it also defines where programs would put the config, called XDG_CONFIG_HOME, which defaults to $HOME/.config.

Deta could use this specification, which means that the config will be placed under $XDG_CONFIG_HOME/deta.

Rationale

Standardization, and making $HOME less cluttered.

Reference

Update `--project` flag in man to reflect docs

At A Glance

update cli man deta new --help --project string deta project to match docs --project string project to create the micro under

Story

As a user, I wanted to init a new miro under one of my other projects. From the cli I ran deta new --help under flags it was unclear that the --project string deta project flag was to associate the micro with a project in the data dashboard. Through the slack help channel, it was brought to my attention that in the docs the --project string project to create the micro under flag is clarified further. This is therefore an oversight on my part, but sometimes tired devs like myself will try and spin up a new Deta micro. ๐Ÿ˜

Expectation

The command reference in the docs and the cli man are consistent.

Further Thoughts

I think it would be helpful and not overburden the docs to call out how to add micros under projects in Getting Started - Creating Your First Micro. This is where I combed to find the answer. But, these are just my thoughts. ๐Ÿคท I'll open an issue in the docs too so the team can decide.

Command not found after failed `new`

Hello,
After an error, deta-cli seems to delete its bin folder.
Please have a look at my shell history:

Step 1: Installing deta-cli:

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % curl -fsSL https://get.deta.dev/cli.sh | sh
######################################################################## 100,0%######################################################################### 100,0%
Archive:  /Users/riccardo/.deta/bin/deta.zip
  inflating: deta                    
  inflating: ._deta                  
Deta was installed successfully to /Users/riccardo/.deta/bin/deta
Run 'deta --help' to get started

Step 2: some quick checks after installation

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % echo $PATH
/Users/riccardo/.deta/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/riccardo/.cargo/bin
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta
total 0
drwxr-----   3 riccardo  staff    96  6 Set 19:54 .
drwxr-xr-x+ 44 riccardo  staff  1408  6 Set 19:51 ..
drwxr-xr-x   4 riccardo  staff   128  6 Set 19:54 bin
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta/bin
total 26720
drwxr-xr-x  4 riccardo  staff       128  6 Set 19:54 .
drwxr-----  3 riccardo  staff        96  6 Set 19:54 ..
-rw-r--r--  1 riccardo  staff       211  7 Lug 13:07 ._deta
-rwxr-xr-x  1 riccardo  staff  13675296  7 Lug 13:07 deta

Step 3: Try to call new without being logged in

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % deta new --python --name test
Error: no auth token found, login with deta login or provide access token

Step 4: Command not found

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % deta
zsh: command not found: deta

Step 5: Post-error checks

The .deta/bin folder is not there anymore.
$PATH is fine.

riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta/bin             
ls: .deta/bin: No such file or directory
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % ls -al .deta                 
total 0
drwxr-----   2 riccardo  staff    64  6 Set 19:54 .
drwxr-xr-x+ 45 riccardo  staff  1440  6 Set 19:54 ..
riccardo@MacBook-Pro-di-Riccardo-M1 ~ % echo $PATH
/Users/riccardo/.deta/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/riccardo/.cargo/bin

System details

OS: macOS 12.0 21A5506j arm64 
Host: MacBookPro17,1 
Kernel: 21.1.0 
Uptime: 9 hours, 50 mins 
Packages: 5 (brew) 
Shell: zsh 5.8 
Terminal: Apple_Terminal 
CPU: Apple M1 
GPU: Apple M1 
Memory: 1219MiB / 8192MiB 

Not allowed to change or delete some files requested

Hey there,

I'm trying to deploy a micro but I'm getting the error from the title instead.

This is basically what happened:

  1. deta new --python
  2. First few deploys worked just fine
  3. Changed some files, formatted, linted, etc.
  4. Try to deploy again and got the error

Prerequisites

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Expected Behavior

I'd like to know the specific files that can't be modified/deleted or another way to fix my deploys.

Current Behavior

When running deta deploy either locally or in a CI workflow using an access token, I get the following error:

โฏ deta deploy
Deploying...
Error: failed to deploy: Not allowed to change or delete some files requested

Context

  • Operating System: Mac OSX 10.15.7
  • SDK version: deta v1.1.2-beta x86_64-darwin

Failure Logs

None that I know of.

Cannot install deta cli in PowerShell Windows

I tried downloading using this script; iwr https://get.deta.dev/cli.ps1 -useb | iex

It did not work and this is the error code:
`The term 'iwr' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spellin
g of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:4

  • iwr <<<< https://get.deta.dev/cli.ps1 -useb | iex
    • CategoryInfo : ObjectNotFound: (iwr:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
      `

feat: Support for connecting existing directory to an existing Micro

Suggestion

Have some sort of connect command in the CLI to seamlessly connect existing directory to an existing Micro without pain.

Workarounds

Currently, the only workaround is copy the contents of $PWD/.deta/prog_info file to the target machine or even set it as an secret in CI settings and do some "echo $DETA_PROG_INFO > .deta/prog_info`.

How do I revert deta new?

While running deta new, it errored out
image

Now I can't even revert it since I could not find any command to do so
image

Allow login from command line

Deta Login is fine, but it would be much better if you could log in from the command line, like for deploying from github actions. Is it possible to add an optional flag for CLI logins? I'd be fine with implementing it.

Problems with authorization through local server

Problem

Many people have problems with the deta login command because it starts a local server and some browsers do not allow connections to localhost. The user may also be running the command in a WSL or in a Docker container where port forwarding to the host machine may not work.

Solution

For authorization, it is better to use the Deta server instead of the local server. For example:

  1. The user enters the deta login command
  2. The program receives a unique login ID string from server (for example UUID)
  3. Starts polling the Deta server every 5 seconds with this string (or starts a long-lived websocket connection).
  4. Outputs a link to the user like https://web.deta.sh/cli/{login ID}
  5. The user clicks on the link, logs in
  6. The program, requesting the next update from the server, receives the tokens.

Solution will require changes on the Deta backend.

Authorization was successful without local server.
Optionally, you can ask the user to enter another unique string, so that the account is not logged in because of an accidental click on the link in the internet.

Yes, it will create additional load on the server, but it will be supported on all browsers with js, including containers and wsl.

This is how github cli works successfully, for example.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.