Repository: ariga/atlas
Pull request #909 (2022-07-05 19:15:10)

cmd/atlas: move cmd/atlas to its own module

rotemtam: Closes https://github.com/ariga/atlas/issues/684
a8m: > This means go run ariga.io/atlas/cmd/atlas won't work until we add those labels we discussed right ?

Just a git tag. I plan to do it after merging.  
rotemtam: > > This means go run ariga.io/atlas/cmd/atlas won't work until we add those labels we discussed right ?
> 
> Just a git tag. I plan to do it after merging.

Nice. Let’s discuss tomorrow how to integrate this with continuous push (canary)

Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d51fb7d4..3a281ae2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,7 +71,7 @@ jobs:
         working-directory: schema
       - name: Run cli tests
         run: go test -race ./...
-        working-directory: cmd/atlascmd
+        working-directory: cmd/atlas
       - name: Run atlasci tests
         run: go test -race ./internal/ci/...
         working-directory: cmd/atlasci
diff --git a/cmd/atlas/doc.go b/cmd/atlas/doc.go
index 1640a691..ec009cf9 100644
--- a/cmd/atlas/doc.go
+++ b/cmd/atlas/doc.go
@@ -14,7 +14,7 @@ import (
 	"strings"
 	"text/template"
 
-	"ariga.io/atlas/cmd/atlascmd"
+	"ariga.io/atlas/cmd/atlas/internal/cmdapi"
 
 	"github.com/spf13/cobra"
 	"github.com/spf13/cobra/doc"
@@ -41,7 +41,7 @@ func main() {
 	if err := t.ExecuteTemplate(f, "header", nil); err != nil {
 		log.Fatal(err)
 	}
-	blocks := prepare(atlascmd.Root, make([]*block, 0), 0)
+	blocks := prepare(cmdapi.Root, make([]*block, 0), 0)
 	if err := t.ExecuteTemplate(f, "body", struct {
 		Blocks []*block
 	}{Blocks: blocks}); err != nil {
diff --git a/cmd/atlas/go.mod b/cmd/atlas/go.mod
new file mode 100644
index 00000000..87cd171e
--- /dev/null
+++ b/cmd/atlas/go.mod
@@ -0,0 +1,40 @@
+module ariga.io/atlas/cmd/atlas
+
+go 1.18
+
+require (
+	ariga.io/atlas v0.4.3
+	entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0
+	github.com/fatih/color v1.13.0
+	github.com/go-sql-driver/mysql v1.6.0
+	github.com/hashicorp/hcl/v2 v2.10.0
+	github.com/lib/pq v1.10.5
+	github.com/manifoldco/promptui v0.9.0
+	github.com/mattn/go-sqlite3 v1.14.10
+	github.com/mitchellh/go-homedir v1.1.0
+	github.com/spf13/cobra v1.4.0
+	github.com/spf13/pflag v1.0.5
+	github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942
+	golang.org/x/mod v0.5.1
+)
+
+require (
+	github.com/agext/levenshtein v1.2.1 // indirect
+	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
+	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/go-openapi/inflect v0.19.0 // indirect
+	github.com/google/go-cmp v0.5.6 // indirect
+	github.com/google/uuid v1.3.0 // indirect
+	github.com/inconshreveable/mousetrap v1.0.0 // indirect
+	github.com/mattn/go-colorable v0.1.12 // indirect
+	github.com/mattn/go-isatty v0.0.14 // indirect
+	github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	github.com/zclconf/go-cty v1.8.0 // indirect
+	golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
+	golang.org/x/text v0.3.7 // indirect
+	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
+)
+
+replace ariga.io/atlas => ../../
diff --git a/cmd/atlas/go.sum b/cmd/atlas/go.sum
new file mode 100644
index 00000000..ec2eea1b
--- /dev/null
+++ b/cmd/atlas/go.sum
@@ -0,0 +1,119 @@
+entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0 h1:qHA4+ANAzDj6BcDLxNgZuzKxFre/RI9r5wwsI2O+1M4=
+entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0/go.mod h1:Zh61BPvB+cL6VWEyN8f1YoDacrMjQf2KDlDeX26xq2k=
+github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
+github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
+github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
+github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
+github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
+github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
+github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
+github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
+github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
+github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
+github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
+github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
+github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
+github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
+github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
+github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
+github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
+github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
+github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
+github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
+github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
+github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
+github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
+github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
+github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
+github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
+github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
+github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
+github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-sqlite3 v1.14.10 h1:MLn+5bFRlWMGoSRmJour3CL1w/qL96mvipqpwQW/Sfk=
+github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
+github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
+github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
+github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
+github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
+github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
+github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942 h1:t0lM6y/M5IiUZyvbBTcngso8SZEZICH7is9B6g/obVU=
+github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
+github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
+github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
+github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8=
+github.com/zclconf/go-cty v1.8.0 h1:s4AvqaeQzJIu3ndv4gVIhplVD0krU+bgrcLSVUnaWuA=
+github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk=
+github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
+golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
+golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
+golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/cmd/atlascmd/atlascmd.go b/cmd/atlas/internal/cmdapi/cmdapi.go
similarity index 97%
rename from cmd/atlascmd/atlascmd.go
rename to cmd/atlas/internal/cmdapi/cmdapi.go
index 7789d0e8..f055729d 100644
--- a/cmd/atlascmd/atlascmd.go
+++ b/cmd/atlas/internal/cmdapi/cmdapi.go
@@ -2,16 +2,16 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-// Package atlascmd holds the atlas commands used to build
+// Package cmdapi holds the atlas commands used to build
 // an atlas distribution.
-package atlascmd
+package cmdapi
 
 import (
 	"fmt"
 	"os"
 	"strings"
 
-	"ariga.io/atlas/cmd/atlascmd/update"
+	"ariga.io/atlas/cmd/atlas/internal/update"
 
 	"github.com/spf13/cobra"
 	"golang.org/x/mod/semver"
diff --git a/cmd/atlascmd/diff.go b/cmd/atlas/internal/cmdapi/diff.go
similarity index 99%
rename from cmd/atlascmd/diff.go
rename to cmd/atlas/internal/cmdapi/diff.go
index 3a8b1a18..6be15120 100644
--- a/cmd/atlascmd/diff.go
+++ b/cmd/atlas/internal/cmdapi/diff.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"strings"
diff --git a/cmd/atlascmd/migrate.go b/cmd/atlas/internal/cmdapi/migrate.go
similarity index 99%
rename from cmd/atlascmd/migrate.go
rename to cmd/atlas/internal/cmdapi/migrate.go
index d735224f..da252946 100644
--- a/cmd/atlascmd/migrate.go
+++ b/cmd/atlas/internal/cmdapi/migrate.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"context"
@@ -15,7 +15,7 @@ import (
 	"strings"
 	"time"
 
-	entmigrate "ariga.io/atlas/cmd/atlascmd/migrate"
+	entmigrate "ariga.io/atlas/cmd/atlas/internal/migrate"
 	"ariga.io/atlas/sql/migrate"
 	"ariga.io/atlas/sql/schema"
 	"ariga.io/atlas/sql/sqlclient"
diff --git a/cmd/atlascmd/project.go b/cmd/atlas/internal/cmdapi/project.go
similarity index 99%
rename from cmd/atlascmd/project.go
rename to cmd/atlas/internal/cmdapi/project.go
index be7c7694..c8565757 100644
--- a/cmd/atlascmd/project.go
+++ b/cmd/atlas/internal/cmdapi/project.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"fmt"
diff --git a/cmd/atlascmd/schema.go b/cmd/atlas/internal/cmdapi/schema.go
similarity index 99%
rename from cmd/atlascmd/schema.go
rename to cmd/atlas/internal/cmdapi/schema.go
index 2b4c84b5..e6e8b14b 100644
--- a/cmd/atlascmd/schema.go
+++ b/cmd/atlas/internal/cmdapi/schema.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"bytes"
diff --git a/cmd/atlascmd/testdata/mysql/20220318104614_initial.sql b/cmd/atlas/internal/cmdapi/testdata/mysql/20220318104614_initial.sql
similarity index 100%
rename from cmd/atlascmd/testdata/mysql/20220318104614_initial.sql
rename to cmd/atlas/internal/cmdapi/testdata/mysql/20220318104614_initial.sql
diff --git a/cmd/atlascmd/testdata/mysql/20220420213403_second.sql b/cmd/atlas/internal/cmdapi/testdata/mysql/20220420213403_second.sql
similarity index 100%
rename from cmd/atlascmd/testdata/mysql/20220420213403_second.sql
rename to cmd/atlas/internal/cmdapi/testdata/mysql/20220420213403_second.sql
diff --git a/cmd/atlascmd/testdata/mysql/atlas.sum b/cmd/atlas/internal/cmdapi/testdata/mysql/atlas.sum
similarity index 100%
rename from cmd/atlascmd/testdata/mysql/atlas.sum
rename to cmd/atlas/internal/cmdapi/testdata/mysql/atlas.sum
diff --git a/cmd/atlascmd/testdata/sqlite/20220318104614_initial.sql b/cmd/atlas/internal/cmdapi/testdata/sqlite/20220318104614_initial.sql
similarity index 100%
rename from cmd/atlascmd/testdata/sqlite/20220318104614_initial.sql
rename to cmd/atlas/internal/cmdapi/testdata/sqlite/20220318104614_initial.sql
diff --git a/cmd/atlascmd/testdata/sqlite/atlas.sum b/cmd/atlas/internal/cmdapi/testdata/sqlite/atlas.sum
similarity index 100%
rename from cmd/atlascmd/testdata/sqlite/atlas.sum
rename to cmd/atlas/internal/cmdapi/testdata/sqlite/atlas.sum
diff --git a/cmd/atlascmd/docker/docker.go b/cmd/atlas/internal/docker/docker.go
similarity index 100%
rename from cmd/atlascmd/docker/docker.go
rename to cmd/atlas/internal/docker/docker.go
diff --git a/cmd/atlascmd/docker/docker_test.go b/cmd/atlas/internal/docker/docker_test.go
similarity index 100%
rename from cmd/atlascmd/docker/docker_test.go
rename to cmd/atlas/internal/docker/docker_test.go
diff --git a/cmd/atlascmd/migrate/ent/client.go b/cmd/atlas/internal/migrate/ent/client.go
similarity index 98%
rename from cmd/atlascmd/migrate/ent/client.go
rename to cmd/atlas/internal/migrate/ent/client.go
index 6f748bfd..decb85ee 100644
--- a/cmd/atlascmd/migrate/ent/client.go
+++ b/cmd/atlas/internal/migrate/ent/client.go
@@ -11,9 +11,9 @@ import (
 	"fmt"
 	"log"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/migrate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/migrate"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 
 	"entgo.io/ent/dialect"
 	"entgo.io/ent/dialect/sql"
diff --git a/cmd/atlascmd/migrate/ent/config.go b/cmd/atlas/internal/migrate/ent/config.go
similarity index 98%
rename from cmd/atlascmd/migrate/ent/config.go
rename to cmd/atlas/internal/migrate/ent/config.go
index 01f2a8d8..e727c427 100644
--- a/cmd/atlascmd/migrate/ent/config.go
+++ b/cmd/atlas/internal/migrate/ent/config.go
@@ -11,7 +11,7 @@ import (
 	stdsql "database/sql"
 	"fmt"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/internal"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/internal"
 	"entgo.io/ent"
 	"entgo.io/ent/dialect"
 )
diff --git a/cmd/atlascmd/migrate/ent/context.go b/cmd/atlas/internal/migrate/ent/context.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/context.go
rename to cmd/atlas/internal/migrate/ent/context.go
diff --git a/cmd/atlascmd/migrate/ent/ent.go b/cmd/atlas/internal/migrate/ent/ent.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/ent.go
rename to cmd/atlas/internal/migrate/ent/ent.go
index 6b7aa7a1..7a9f46f9 100644
--- a/cmd/atlascmd/migrate/ent/ent.go
+++ b/cmd/atlas/internal/migrate/ent/ent.go
@@ -11,7 +11,7 @@ import (
 	"errors"
 	"fmt"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent"
 	"entgo.io/ent/dialect/sql"
 	"entgo.io/ent/dialect/sql/sqlgraph"
diff --git a/cmd/atlascmd/migrate/ent/generate.go b/cmd/atlas/internal/migrate/ent/generate.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/generate.go
rename to cmd/atlas/internal/migrate/ent/generate.go
diff --git a/cmd/atlascmd/migrate/ent/hook/hook.go b/cmd/atlas/internal/migrate/ent/hook/hook.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/hook/hook.go
rename to cmd/atlas/internal/migrate/ent/hook/hook.go
index 4f3b54b6..290222a6 100644
--- a/cmd/atlascmd/migrate/ent/hook/hook.go
+++ b/cmd/atlas/internal/migrate/ent/hook/hook.go
@@ -10,7 +10,7 @@ import (
 	"context"
 	"fmt"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent"
 )
 
 // The RevisionFunc type is an adapter to allow the use of ordinary
diff --git a/cmd/atlascmd/migrate/ent/internal/schemaconfig.go b/cmd/atlas/internal/migrate/ent/internal/schemaconfig.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/internal/schemaconfig.go
rename to cmd/atlas/internal/migrate/ent/internal/schemaconfig.go
diff --git a/cmd/atlascmd/migrate/ent/migrate/migrate.go b/cmd/atlas/internal/migrate/ent/migrate/migrate.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/migrate/migrate.go
rename to cmd/atlas/internal/migrate/ent/migrate/migrate.go
diff --git a/cmd/atlascmd/migrate/ent/migrate/schema.go b/cmd/atlas/internal/migrate/ent/migrate/schema.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/migrate/schema.go
rename to cmd/atlas/internal/migrate/ent/migrate/schema.go
diff --git a/cmd/atlascmd/migrate/ent/mutation.go b/cmd/atlas/internal/migrate/ent/mutation.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/mutation.go
rename to cmd/atlas/internal/migrate/ent/mutation.go
index 997cff5d..cff27a52 100644
--- a/cmd/atlascmd/migrate/ent/mutation.go
+++ b/cmd/atlas/internal/migrate/ent/mutation.go
@@ -13,8 +13,8 @@ import (
 	"sync"
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/predicate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/predicate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 
 	"entgo.io/ent"
 )
diff --git a/cmd/atlascmd/migrate/ent/predicate/predicate.go b/cmd/atlas/internal/migrate/ent/predicate/predicate.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/predicate/predicate.go
rename to cmd/atlas/internal/migrate/ent/predicate/predicate.go
diff --git a/cmd/atlascmd/migrate/ent/revision.go b/cmd/atlas/internal/migrate/ent/revision.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/revision.go
rename to cmd/atlas/internal/migrate/ent/revision.go
index ad1d5378..dc777420 100644
--- a/cmd/atlascmd/migrate/ent/revision.go
+++ b/cmd/atlas/internal/migrate/ent/revision.go
@@ -12,7 +12,7 @@ import (
 	"strings"
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent/dialect/sql"
 )
 
diff --git a/cmd/atlascmd/migrate/ent/revision/revision.go b/cmd/atlas/internal/migrate/ent/revision/revision.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/revision/revision.go
rename to cmd/atlas/internal/migrate/ent/revision/revision.go
diff --git a/cmd/atlascmd/migrate/ent/revision/where.go b/cmd/atlas/internal/migrate/ent/revision/where.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/revision/where.go
rename to cmd/atlas/internal/migrate/ent/revision/where.go
index adca2b50..1e8e5412 100644
--- a/cmd/atlascmd/migrate/ent/revision/where.go
+++ b/cmd/atlas/internal/migrate/ent/revision/where.go
@@ -9,7 +9,7 @@ package revision
 import (
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/predicate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/predicate"
 	"entgo.io/ent/dialect/sql"
 )
 
diff --git a/cmd/atlascmd/migrate/ent/revision_create.go b/cmd/atlas/internal/migrate/ent/revision_create.go
similarity index 99%
rename from cmd/atlascmd/migrate/ent/revision_create.go
rename to cmd/atlas/internal/migrate/ent/revision_create.go
index aa545480..364d4f95 100644
--- a/cmd/atlascmd/migrate/ent/revision_create.go
+++ b/cmd/atlas/internal/migrate/ent/revision_create.go
@@ -12,7 +12,7 @@ import (
 	"fmt"
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent/dialect"
 	"entgo.io/ent/dialect/sql"
 	"entgo.io/ent/dialect/sql/sqlgraph"
diff --git a/cmd/atlascmd/migrate/ent/revision_delete.go b/cmd/atlas/internal/migrate/ent/revision_delete.go
similarity index 94%
rename from cmd/atlascmd/migrate/ent/revision_delete.go
rename to cmd/atlas/internal/migrate/ent/revision_delete.go
index 1e0565b5..2fadc842 100644
--- a/cmd/atlascmd/migrate/ent/revision_delete.go
+++ b/cmd/atlas/internal/migrate/ent/revision_delete.go
@@ -10,9 +10,9 @@ import (
 	"context"
 	"fmt"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/internal"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/predicate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/internal"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/predicate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent/dialect/sql"
 	"entgo.io/ent/dialect/sql/sqlgraph"
 	"entgo.io/ent/schema/field"
diff --git a/cmd/atlascmd/migrate/ent/revision_query.go b/cmd/atlas/internal/migrate/ent/revision_query.go
similarity index 98%
rename from cmd/atlascmd/migrate/ent/revision_query.go
rename to cmd/atlas/internal/migrate/ent/revision_query.go
index abd13ec9..54a93f21 100644
--- a/cmd/atlascmd/migrate/ent/revision_query.go
+++ b/cmd/atlas/internal/migrate/ent/revision_query.go
@@ -11,9 +11,9 @@ import (
 	"fmt"
 	"math"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/internal"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/predicate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/internal"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/predicate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent/dialect/sql"
 	"entgo.io/ent/dialect/sql/sqlgraph"
 	"entgo.io/ent/schema/field"
diff --git a/cmd/atlascmd/migrate/ent/revision_update.go b/cmd/atlas/internal/migrate/ent/revision_update.go
similarity index 98%
rename from cmd/atlascmd/migrate/ent/revision_update.go
rename to cmd/atlas/internal/migrate/ent/revision_update.go
index 7e10581e..07aa5f76 100644
--- a/cmd/atlascmd/migrate/ent/revision_update.go
+++ b/cmd/atlas/internal/migrate/ent/revision_update.go
@@ -12,9 +12,9 @@ import (
 	"fmt"
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/internal"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/predicate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/internal"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/predicate"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"entgo.io/ent/dialect/sql"
 	"entgo.io/ent/dialect/sql/sqlgraph"
 	"entgo.io/ent/schema/field"
diff --git a/cmd/atlascmd/migrate/ent/runtime.go b/cmd/atlas/internal/migrate/ent/runtime.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/runtime.go
rename to cmd/atlas/internal/migrate/ent/runtime.go
diff --git a/cmd/atlascmd/migrate/ent/runtime/runtime.go b/cmd/atlas/internal/migrate/ent/runtime/runtime.go
similarity index 92%
rename from cmd/atlascmd/migrate/ent/runtime/runtime.go
rename to cmd/atlas/internal/migrate/ent/runtime/runtime.go
index 729f0d13..4a0e8864 100644
--- a/cmd/atlascmd/migrate/ent/runtime/runtime.go
+++ b/cmd/atlas/internal/migrate/ent/runtime/runtime.go
@@ -6,7 +6,7 @@
 
 package runtime
 
-// The schema-stitching logic is generated in ariga.io/atlas/cmd/atlascmd/migrate/ent/runtime.go
+// The schema-stitching logic is generated in ariga.io/atlas/cmd/atlas/internal/migrate/ent/runtime.go
 
 const (
 	Version = "v0.10.2-0.20220502113020-4ac82f5bb3f0"           // Version of ent codegen.
diff --git a/cmd/atlascmd/migrate/ent/schema/revision.go b/cmd/atlas/internal/migrate/ent/schema/revision.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/schema/revision.go
rename to cmd/atlas/internal/migrate/ent/schema/revision.go
diff --git a/cmd/atlascmd/migrate/ent/tx.go b/cmd/atlas/internal/migrate/ent/tx.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/tx.go
rename to cmd/atlas/internal/migrate/ent/tx.go
diff --git a/cmd/atlascmd/migrate/migrate.go b/cmd/atlas/internal/migrate/migrate.go
similarity index 98%
rename from cmd/atlascmd/migrate/migrate.go
rename to cmd/atlas/internal/migrate/migrate.go
index 28f58cb9..b1e5b2a1 100644
--- a/cmd/atlascmd/migrate/migrate.go
+++ b/cmd/atlas/internal/migrate/migrate.go
@@ -8,8 +8,8 @@ import (
 	"context"
 	"errors"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"ariga.io/atlas/sql/migrate"
 	"ariga.io/atlas/sql/schema"
 	"ariga.io/atlas/sql/sqlclient"
diff --git a/cmd/atlascmd/update/update.go b/cmd/atlas/internal/update/update.go
similarity index 100%
rename from cmd/atlascmd/update/update.go
rename to cmd/atlas/internal/update/update.go
diff --git a/cmd/atlascmd/update/update_test.go b/cmd/atlas/internal/update/update_test.go
similarity index 100%
rename from cmd/atlascmd/update/update_test.go
rename to cmd/atlas/internal/update/update_test.go
diff --git a/cmd/atlas/main.go b/cmd/atlas/main.go
index ba482ab5..f2258c00 100644
--- a/cmd/atlas/main.go
+++ b/cmd/atlas/main.go
@@ -9,8 +9,8 @@ import (
 	"os"
 	"os/signal"
 
-	"ariga.io/atlas/cmd/atlascmd"
-	_ "ariga.io/atlas/cmd/atlascmd/docker"
+	"ariga.io/atlas/cmd/atlas/internal/cmdapi"
+	_ "ariga.io/atlas/cmd/atlas/internal/docker"
 	_ "ariga.io/atlas/sql/mysql"
 	_ "ariga.io/atlas/sql/postgres"
 	_ "ariga.io/atlas/sql/sqlite"
@@ -22,9 +22,9 @@ import (
 
 func main() {
 	ctx, _ := signal.NotifyContext(context.Background(), os.Interrupt, os.Kill)
-	atlascmd.Root.SetOut(os.Stdout)
-	err := atlascmd.Root.ExecuteContext(ctx)
-	atlascmd.CheckForUpdate()
+	cmdapi.Root.SetOut(os.Stdout)
+	err := cmdapi.Root.ExecuteContext(ctx)
+	cmdapi.CheckForUpdate()
 	if err != nil {
 		os.Exit(1)
 	}
diff --git a/cmd/atlasci/main.go b/cmd/atlasci/main.go
index d2d6fd65..b13484b2 100644
--- a/cmd/atlasci/main.go
+++ b/cmd/atlasci/main.go
@@ -13,7 +13,6 @@ import (
 	"text/template"
 
 	"ariga.io/atlas/cmd/atlasci/internal/ci"
-	_ "ariga.io/atlas/cmd/atlascmd/docker"
 	"ariga.io/atlas/sql/migrate"
 	_ "ariga.io/atlas/sql/mysql"
 	_ "ariga.io/atlas/sql/postgres"
diff --git a/go.mod b/go.mod
index c521b8a9..10556d4f 100644
--- a/go.mod
+++ b/go.mod
@@ -3,18 +3,9 @@ module ariga.io/atlas
 go 1.17
 
 require (
-	entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0
 	github.com/DATA-DOG/go-sqlmock v1.5.0
-	github.com/fatih/color v1.13.0
 	github.com/go-openapi/inflect v0.19.0
-	github.com/go-sql-driver/mysql v1.6.0
 	github.com/hashicorp/hcl/v2 v2.10.0
-	github.com/lib/pq v1.10.5
-	github.com/manifoldco/promptui v0.9.0
-	github.com/mattn/go-sqlite3 v1.14.10
-	github.com/mitchellh/go-homedir v1.1.0
-	github.com/spf13/cobra v1.4.0
-	github.com/spf13/pflag v1.0.5
 	github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942
 	github.com/zclconf/go-cty v1.8.0
 	golang.org/x/mod v0.5.1
@@ -23,17 +14,12 @@ require (
 require (
 	github.com/agext/levenshtein v1.2.1 // indirect
 	github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
-	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/google/go-cmp v0.5.6 // indirect
-	github.com/google/uuid v1.3.0 // indirect
-	github.com/inconshreveable/mousetrap v1.0.0 // indirect
 	github.com/kr/text v0.2.0 // indirect
-	github.com/mattn/go-colorable v0.1.12 // indirect
-	github.com/mattn/go-isatty v0.0.14 // indirect
 	github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
-	golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
 	golang.org/x/text v0.3.7 // indirect
+	golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
 	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
 )
diff --git a/go.sum b/go.sum
index 770ad76f..e721ca2f 100644
--- a/go.sum
+++ b/go.sum
@@ -1,30 +1,18 @@
-entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0 h1:qHA4+ANAzDj6BcDLxNgZuzKxFre/RI9r5wwsI2O+1M4=
-entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0/go.mod h1:Zh61BPvB+cL6VWEyN8f1YoDacrMjQf2KDlDeX26xq2k=
 github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
 github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
 github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
 github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
 github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
+github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0=
 github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk=
 github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw=
 github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo=
-github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
-github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8=
-github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
-github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
-github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
-github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
 github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
 github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
-github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
-github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
 github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
 github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
 github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
@@ -33,12 +21,8 @@ github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW
 github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
 github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
-github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/hashicorp/hcl/v2 v2.10.0 h1:1S1UnuhDGlv3gRFV4+0EdwB+znNP5HmcGbIqwnSCByg=
 github.com/hashicorp/hcl/v2 v2.10.0/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg=
-github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
-github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -47,33 +31,13 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
 github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
-github.com/lib/pq v1.10.5 h1:J+gdV2cUmX7ZqL2B0lFcW0m+egaHC2V3lpO8nWxyYiQ=
-github.com/lib/pq v1.10.5/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
-github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
-github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
-github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
-github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
-github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
-github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
-github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
-github.com/mattn/go-sqlite3 v1.14.10 h1:MLn+5bFRlWMGoSRmJour3CL1w/qL96mvipqpwQW/Sfk=
-github.com/mattn/go-sqlite3 v1.14.10/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
-github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
-github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
 github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
 github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
 github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
-github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q=
-github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g=
 github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
-github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
-github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.7.1-0.20210427113832-6241f9ab9942 h1:t0lM6y/M5IiUZyvbBTcngso8SZEZICH7is9B6g/obVU=
@@ -87,37 +51,36 @@ github.com/zclconf/go-cty v1.8.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUA
 github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8=
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
 golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
 golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
 golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/internal/ci/ci.tmpl b/internal/ci/ci.tmpl
index b2a8c8c1..db3cc501 100644
--- a/internal/ci/ci.tmpl
+++ b/internal/ci/ci.tmpl
@@ -71,7 +71,7 @@ jobs:
         working-directory: schema
       - name: Run cli tests
         run: go test -race ./...
-        working-directory: cmd/atlascmd
+        working-directory: cmd/atlas
       - name: Run atlasci tests
         run: go test -race ./internal/ci/...
         working-directory: cmd/atlasci
diff --git a/internal/integration/go.mod b/internal/integration/go.mod
index 074f8e4e..f327655c 100644
--- a/internal/integration/go.mod
+++ b/internal/integration/go.mod
@@ -4,10 +4,13 @@ go 1.17
 
 replace ariga.io/atlas => ../../
 
+replace ariga.io/atlas/cmd/atlas => ../../cmd/atlas
+
 replace ariga.io/atlas/cmd/atlasci => ../../cmd/atlasci
 
 require (
-	ariga.io/atlas v0.4.1
+	ariga.io/atlas v0.4.3
+	ariga.io/atlas/cmd/atlas v0.4.3
 	entgo.io/ent v0.10.2-0.20220502113020-4ac82f5bb3f0
 	github.com/go-sql-driver/mysql v1.6.0
 	github.com/hashicorp/hcl/v2 v2.10.1 // indirect


Test patch:
diff --git a/cmd/atlascmd/atlascmd_test.go b/cmd/atlas/internal/cmdapi/cmdapi_test.go
similarity index 89%
rename from cmd/atlascmd/atlascmd_test.go
rename to cmd/atlas/internal/cmdapi/cmdapi_test.go
index 9ee0d368..b22247f9 100644
--- a/cmd/atlascmd/atlascmd_test.go
+++ b/cmd/atlas/internal/cmdapi/cmdapi_test.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"bytes"
@@ -10,7 +10,7 @@ import (
 	"os/exec"
 	"testing"
 
-	"ariga.io/atlas/cmd/atlascmd/update"
+	"ariga.io/atlas/cmd/atlas/internal/update"
 
 	"github.com/stretchr/testify/require"
 )
@@ -48,7 +48,7 @@ func TestCLI_Version(t *testing.T) {
 			name: "release",
 			cmd: exec.Command("go", "run",
 				"-ldflags",
-				"-X ariga.io/atlas/cmd/atlascmd.version=v1.2.3",
+				"-X ariga.io/atlas/cmd/atlas/internal/cmdapi.version=v1.2.3",
 				"ariga.io/atlas/cmd/atlas",
 				"version",
 			),
@@ -58,7 +58,7 @@ func TestCLI_Version(t *testing.T) {
 			name: "canary",
 			cmd: exec.Command("go", "run",
 				"-ldflags",
-				"-X ariga.io/atlas/cmd/atlascmd.version=v0.3.0-6539f2704b5d-canary",
+				"-X ariga.io/atlas/cmd/atlas/internal/cmdapi.version=v0.3.0-6539f2704b5d-canary",
 				"ariga.io/atlas/cmd/atlas",
 				"version",
 			),
diff --git a/cmd/atlascmd/diff_test.go b/cmd/atlas/internal/cmdapi/diff_test.go
similarity index 99%
rename from cmd/atlascmd/diff_test.go
rename to cmd/atlas/internal/cmdapi/diff_test.go
index 82e3d532..d13d6014 100644
--- a/cmd/atlascmd/diff_test.go
+++ b/cmd/atlas/internal/cmdapi/diff_test.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"bytes"
diff --git a/cmd/atlascmd/migrate_test.go b/cmd/atlas/internal/cmdapi/migrate_test.go
similarity index 99%
rename from cmd/atlascmd/migrate_test.go
rename to cmd/atlas/internal/cmdapi/migrate_test.go
index 45c4092c..92b538ab 100644
--- a/cmd/atlascmd/migrate_test.go
+++ b/cmd/atlas/internal/cmdapi/migrate_test.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"context"
diff --git a/cmd/atlascmd/project_test.go b/cmd/atlas/internal/cmdapi/project_test.go
similarity index 99%
rename from cmd/atlascmd/project_test.go
rename to cmd/atlas/internal/cmdapi/project_test.go
index 5f655009..8e65af93 100644
--- a/cmd/atlascmd/project_test.go
+++ b/cmd/atlas/internal/cmdapi/project_test.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"os"
diff --git a/cmd/atlascmd/schema_test.go b/cmd/atlas/internal/cmdapi/schema_test.go
similarity index 99%
rename from cmd/atlascmd/schema_test.go
rename to cmd/atlas/internal/cmdapi/schema_test.go
index e447b410..8286b38d 100644
--- a/cmd/atlascmd/schema_test.go
+++ b/cmd/atlas/internal/cmdapi/schema_test.go
@@ -2,7 +2,7 @@
 // This source code is licensed under the Apache 2.0 license found
 // in the LICENSE file in the root directory of this source tree.
 
-package atlascmd
+package cmdapi
 
 import (
 	"bytes"
diff --git a/cmd/atlascmd/migrate/ent/entc.go b/cmd/atlas/internal/migrate/ent/entc.go
similarity index 100%
rename from cmd/atlascmd/migrate/ent/entc.go
rename to cmd/atlas/internal/migrate/ent/entc.go
diff --git a/cmd/atlascmd/migrate/ent/enttest/enttest.go b/cmd/atlas/internal/migrate/ent/enttest/enttest.go
similarity index 94%
rename from cmd/atlascmd/migrate/ent/enttest/enttest.go
rename to cmd/atlas/internal/migrate/ent/enttest/enttest.go
index 916cab9c..2ba12539 100644
--- a/cmd/atlascmd/migrate/ent/enttest/enttest.go
+++ b/cmd/atlas/internal/migrate/ent/enttest/enttest.go
@@ -9,9 +9,9 @@ package enttest
 import (
 	"context"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent"
 	// required by schema hooks.
-	_ "ariga.io/atlas/cmd/atlascmd/migrate/ent/runtime"
+	_ "ariga.io/atlas/cmd/atlas/internal/migrate/ent/runtime"
 
 	"entgo.io/ent/dialect/sql/schema"
 )
diff --git a/cmd/atlascmd/migrate/migrate_test.go b/cmd/atlas/internal/migrate/migrate_test.go
similarity index 96%
rename from cmd/atlascmd/migrate/migrate_test.go
rename to cmd/atlas/internal/migrate/migrate_test.go
index 1064367d..73ddeec2 100644
--- a/cmd/atlascmd/migrate/migrate_test.go
+++ b/cmd/atlas/internal/migrate/migrate_test.go
@@ -11,7 +11,7 @@ import (
 	"testing"
 	"time"
 
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
+	"ariga.io/atlas/cmd/atlas/internal/migrate/ent/revision"
 	"ariga.io/atlas/sql/migrate"
 	"ariga.io/atlas/sql/sqlclient"
 	_ "github.com/mattn/go-sqlite3"
diff --git a/internal/integration/cockroach_test.go b/internal/integration/cockroach_test.go
index cf019d63..c8b3ae84 100644
--- a/internal/integration/cockroach_test.go
+++ b/internal/integration/cockroach_test.go
@@ -78,12 +78,6 @@ func crdbRun(t *testing.T, fn func(*crdbTest)) {
 	}
 }
 
-func TestCockroach_EntRevisions(t *testing.T) {
-	crdbRun(t, func(t *crdbTest) {
-		testEntRevisions(t)
-	})
-}
-
 func TestCockroach_Executor(t *testing.T) {
 	crdbRun(t, func(t *crdbTest) {
 		testExecutor(t)
diff --git a/internal/integration/integration_test.go b/internal/integration/integration_test.go
index 5e1025b7..ca9c9830 100644
--- a/internal/integration/integration_test.go
+++ b/internal/integration/integration_test.go
@@ -21,12 +21,9 @@ import (
 	"text/template"
 	"time"
 
-	entmigrate "ariga.io/atlas/cmd/atlascmd/migrate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
 	"ariga.io/atlas/schema/schemaspec"
 	"ariga.io/atlas/sql/migrate"
 	"ariga.io/atlas/sql/schema"
-	"ariga.io/atlas/sql/sqlclient"
 	entsql "entgo.io/ent/dialect/sql"
 	entschema "entgo.io/ent/dialect/sql/schema"
 	"entgo.io/ent/entc/integration/ent"
@@ -473,25 +470,6 @@ func testAdvisoryLock(t *testing.T, l schema.Locker) {
 	})
 }
 
-// testEntRevisions will not be run for SQLite. It has its own version of this test.
-func testEntRevisions(t T) {
-	const name = "my_revisions_schema"
-
-	c, err := sqlclient.Open(context.Background(), t.url())
-	require.NoError(t, err)
-
-	r, err := entmigrate.NewEntRevisions(c, entmigrate.WithSchema(name))
-	require.NoError(t, err)
-
-	require.NoError(t, r.Init(context.Background()))
-	t.dropSchemas(name)
-
-	s, err := c.InspectSchema(context.Background(), name, nil)
-	require.NoError(t, err)
-	_, ok := s.Table(revision.Table)
-	require.True(t, ok)
-}
-
 func testExecutor(t T) {
 	usersT, postsT := t.users(), t.posts()
 	petsT := &schema.Table{
diff --git a/internal/integration/mysql_test.go b/internal/integration/mysql_test.go
index 9ea2d7f7..3c9bb745 100644
--- a/internal/integration/mysql_test.go
+++ b/internal/integration/mysql_test.go
@@ -79,12 +79,6 @@ func myRun(t *testing.T, fn func(*myTest)) {
 	}
 }
 
-func TestMySQL_EntRevisions(t *testing.T) {
-	myRun(t, func(t *myTest) {
-		testEntRevisions(t)
-	})
-}
-
 func TestMySQL_Executor(t *testing.T) {
 	myRun(t, func(t *myTest) {
 		testExecutor(t)
diff --git a/internal/integration/postgres_test.go b/internal/integration/postgres_test.go
index 03337739..504a4db4 100644
--- a/internal/integration/postgres_test.go
+++ b/internal/integration/postgres_test.go
@@ -79,12 +79,6 @@ func pgRun(t *testing.T, fn func(*pgTest)) {
 	}
 }
 
-func TestPostgres_EntRevisions(t *testing.T) {
-	pgRun(t, func(t *pgTest) {
-		testEntRevisions(t)
-	})
-}
-
 func TestPostgres_Executor(t *testing.T) {
 	pgRun(t, func(t *pgTest) {
 		testExecutor(t)
diff --git a/internal/integration/sqlite_test.go b/internal/integration/sqlite_test.go
index 670d99d0..c1275807 100644
--- a/internal/integration/sqlite_test.go
+++ b/internal/integration/sqlite_test.go
@@ -15,12 +15,9 @@ import (
 	"strings"
 	"testing"
 
-	entmigrate "ariga.io/atlas/cmd/atlascmd/migrate"
-	"ariga.io/atlas/cmd/atlascmd/migrate/ent/revision"
 	"ariga.io/atlas/sql/migrate"
 	"ariga.io/atlas/sql/postgres"
 	"ariga.io/atlas/sql/schema"
-	"ariga.io/atlas/sql/sqlclient"
 	"ariga.io/atlas/sql/sqlite"
 
 	"entgo.io/ent/dialect"
@@ -50,23 +47,6 @@ func liteRun(t *testing.T, fn func(test *liteTest)) {
 	fn(tt)
 }
 
-func TestSQLite_EntRevisions(t *testing.T) {
-	liteRun(t, func(t *liteTest) {
-		c, err := sqlclient.Open(context.Background(), t.url())
-		require.NoError(t, err)
-
-		r, err := entmigrate.NewEntRevisions(c)
-		require.NoError(t, err)
-
-		require.NoError(t, r.Init(context.Background()))
-
-		s, err := c.InspectSchema(context.Background(), "", nil)
-		require.NoError(t, err)
-		_, ok := s.Table(revision.Table)
-		require.True(t, ok)
-	})
-}
-
 func TestSQLite_Executor(t *testing.T) {
 	liteRun(t, func(t *liteTest) {
 		testExecutor(t)
diff --git a/internal/integration/tidb_test.go b/internal/integration/tidb_test.go
index 9d1535c2..79002c63 100644
--- a/internal/integration/tidb_test.go
+++ b/internal/integration/tidb_test.go
@@ -67,12 +67,6 @@ func tidbRun(t *testing.T, fn func(*myTest)) {
 	}
 }
 
-func TestTiDB_EntRevisions(t *testing.T) {
-	tidbRun(t, func(t *myTest) {
-		testEntRevisions(t)
-	})
-}
-
 func TestTiDB_AddDropTable(t *testing.T) {
 	tidbRun(t, func(t *myTest) {
 		testAddDrop(t)